|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cafesip.gwtcomp.client.utils.AsyncCallback<T>
public abstract class AsyncCallback<T>
This abstract class can be used in place of GWT AsyncCallback to automatically handle authentication request from the HTTP servlet container. An authentication form is sent by the servlet container to the browser in response to a HTTP request when the HTTP session has timed out because of inactivity and the URL being accessed has an authentication constraint. An RPC call is a HTTP request and therefore, is given the same treatment. GWT does not handle this very well. The RPC call fails with an exception and the application has to handle this. This class takes care of the problem by handling the exception transparantly. The servlet sends the the login form that the web application has specified in the web.xml deployment descriptor. For more details, see the HTTP Servlet documentation.
For this to work, the login form must provide an indication to this class that it is a login form by adding the string "" (without the quotes) before any other HTML/text segments. In addition, the static setLoginURL() method must be called prior to using this class.
The abstract methods are invoked when the RPC response is received from the server.
| Constructor Summary | |
|---|---|
AsyncCallback()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getLoginURL()
|
abstract void |
onException(java.lang.Throwable caught)
This method is invoked when the GWTServlet throws an exception. |
void |
onFailure(java.lang.Throwable caught)
|
abstract void |
onSuccess(java.lang.Object result)
|
static void |
setLoginURL(java.lang.String loginURL)
Set the login URL. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AsyncCallback()
| Method Detail |
|---|
public final void onFailure(java.lang.Throwable caught)
onFailure in interface com.google.gwt.user.client.rpc.AsyncCallback<T>public abstract void onSuccess(java.lang.Object result)
onSuccess in interface com.google.gwt.user.client.rpc.AsyncCallback<T>public abstract void onException(java.lang.Throwable caught)
caught - public static java.lang.String getLoginURL()
public static void setLoginURL(java.lang.String loginURL)
loginURL - The loginURL to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||