Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graceful handling of server timeout in BlazeDS

I have a flex client that makes service calls to a tomcat server running BlazeDS. I would like to gracefully handle server session timeouts in this environment.

I do have security constraints on the service, so the client authenticates against a remote object by initializing a ChannelSet based on the destination, and then logging in using that ChannelSet.

After the user is authenticated, if they go get a (long) cup of coffee, their session will inevitably time out.

I would like the client to detect the timeout, and return the user back to the login page, with the appropriate informational messages.

But I am having difficulty finding the best way to detect this timeout from the client. Is it possible, or must I have the server throw an error when the timeout occurs?

Thanks!

like image 315
Rydell Avatar asked Nov 11 '08 17:11

Rydell


2 Answers

We wrote a custom component for the client capturing Keystrokes and mouse events and then handle timeouts on the client.

like image 72
Kapil Viren Ahuja Avatar answered Sep 30 '22 14:09

Kapil Viren Ahuja


We implemented a custom UI service which pings the server constantly (1 ping per 10 minutes) thus preventing AppServer from shutting down the connection. We also run some internal UI timer which is dropped each time any request is made (except the "ping" one) with a complete function calling UI to switch back to login and show "Session expired due to client inactivity".

like image 41
Jaroslav Danilov Avatar answered Sep 30 '22 13:09

Jaroslav Danilov