benstpierre
benstpierre

Reputation: 33571

A nice way to detect an expired session in an application that uses GWT and GWT-RPC almost exclusively?

If I were on a regular JSP application I would simple write a servlet filter that if it detects an expired session redirects you to a page that explains your session has expired.

In GWT are only doing calls in the background so a http response redirect would not reload the page. Other than having all GWT rpc calls inside a base object that returns the session status does anybody have a suggested way to detect an expired session? Perhaps a timer that calls an RPC method every 5 minutes?

Upvotes: 2

Views: 293

Answers (1)

jusio
jusio

Reputation: 9900

Normal way is to throw an error on GWT-RPC call saying that the session is expired. Then you need to handle that exception on the client side (f.e. display login page to the user or something else).

Upvotes: 3

Related Questions