Thursday, July 1, 2010

How to refresh using filter

I would like to use the filter to do a refresh on the page so that if
the system is idle for a period of time he returns to login screen, I
wonder how I can do this, I tried to use the jsni:

public class Filtro implements Filter {
public void destroy() {

}

public void doFilter(ServletRequest request, ServletResponse reponse,
FilterChain chain) throws IOException, ServletException {
if((Integer)((HttpServletRequest)request).getSession().getAttribute("code")
== null) {
reload();
}
chain.doFilter(request, reponse);
}

public void init(FilterConfig config) throws ServletException {

}

public static native void reload() /*-{
$wnd.location.reload();
}-*/;
}

If someone knows any other solution is welcome.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment