This is one area where gwt could improve. We ended up patching ProxyCreator (look up the class) to automatically retry any requests with strange error codes (0, 12090, 400), and now that I think about it, it would be nice to do this for session timeouts as well.
It would be great if gwt could provide a mechanism to provide a custom retry behavior as standard that applies globally, rather than having to do it for every async method yourself. If anyone's interested in collaborating on this let me know. On Feb 6, 10:24 am, Jamie <[email protected]> wrote: > Hi everybody. I'm trying to extend AsyncCallback to always have the > same behavior onFailure. I can successfully catch the session timeout > exception that I'm looking for, open a login dialog, and have the user > login. What I want to do after that is done is to resubmit the > original RPC call that caused the onfailure. Here's what I have so > far: > > <code> > public abstract class MyAsyncCallback<T> implements AsyncCallback<T> { > > public final void onFailure(Throwable caught) { > if(caught instanceof StatusCodeException && > ((StatusCodeException)caught).getStatusCode() == 401) { > final LoginDialog login = new LoginDialog(); > login.addLoginDialogListener(new > LoginDialogListener() { > public void loginSuccess() { > login.hide(); > //RESUBMIT THE ORIGINAL RPC HERE > } > }); > } else { > Window.alert("An error has occurred. Contact your > system > administrator."); > } > } > > public final void onSuccess(T result) { > uponSuccess(result); > } > > public abstract void uponSuccess(T result); > > } > > </code> > > Does anybody know how I can capture the original RPC before it is sent > so I can resubmit it? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
