Hi Magnus
You can implement a java Filter in the server Side and check if the session is valid
if is not valid yo do the redirect in the server side.
you can use that way if you call a normal resource to the server for example a .js or img or .jsp or html
to use it for a RPC call you must implement a custom response to the client , and there manage the redirect
something like that, in your web.xml
<filter>
<filter-name>MyFilter</filter-name>
<filter-class>com.mycompany.myapp.MyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>MyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
in the client side you must have a class like
public abstract class DefaultAsyncCallback<T> implements AsyncCallback<T> {
private void handleException(Throwable caught) {
String msg = caught.getMessage();
if(caught instanceof SerializableException) {
SerializableException se = (SerializableException)caught;
msg = se.getMessage();
String[] tokens = msg.split("\\|");
if ("some custom code to do the redirect".equals(tokens[0])){
GWT.log("Token invalido, redirect a: "+tokens[1], null);
redirect(tokens[1]);
return;
}
}
Regards