• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

How to handle a session timeout exception (with MVP Places and Activities) ?

Ranch Hand
Posts: 560
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do you handle a time out request in a GWT app ?
Here is a snipped of my web.xml file :

My GWT project is based on MVP Activities and Places.
Whenever the user waits more than 30mn, i want to display a popup and redirect the user to the login page. Here is what i do for
all RPC services :
public void onFailure(Throwable caught) {
if (caught instanceof InvocationException) {
Window.alert("Time out de session. Veuillez vous reconnecter. 2");
Window.open(GWT.getHostPageBaseURL() + "identification.html", "_self", null);

It works but several things are annoying :
1) the caught exception should be RequestTimeoutException. But it's not caught, which is why i use InvocationException instead.
How come it's not caught ?
2) how can i handle this exception in a more generic way ? It's a bit stupid to have to catch that exception in all RPC services ...
I read about some AsyncCallbackAdapter class ...
3) Right now i handle RPC services only but of course time out exception occurs everywhere : links, buttons, page refresh ...
I'm using MVP Places and Activities.
Is there a way to catch that exception when the user tries to go to a place ?

Thanks for helping
Hey! Wanna see my flashlight? It looks like this tiny ad:
Enterprise-grade Excel API for Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!