wood burning stoves 2.0*
The moose likes Struts and the fly likes How to properly handle server Timeout ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to properly handle server Timeout ?" Watch "How to properly handle server Timeout ?" New topic

How to properly handle server Timeout ?

Franck Tranchant
Ranch Hand

Joined: Aug 07, 2003
Posts: 75
I'm currently working on a struts-based application running on Weblogic 7.0 and I wonder how to properly handle server Timeout.
For the moment, i've nothing special configured/coded so, when the weblogic "Session Timeout" for my application happens, naturally, i do have an horrible error message on screen due to NullPointerExceptions in the Action class.

So, how could I detect the timeout and then forward to a specific JSP ?
Many thanks in advance..

Junilu Lacar

Joined: Feb 26, 2001
Posts: 4445

One option is to use a Filter configured for your ActionServlet. You would set a session-scoped attribute and the filter would check for it.
Another option is to use the Token mechanism in the Action class. See http://www.husted.com for examples in using the Struts token.

Junilu - [How to Ask Questions] [How to Answer Questions]
Franck Tranchant
Ranch Hand

Joined: Aug 07, 2003
Posts: 75
What about this one :
In every Action class, I first check the
request.isRequestedSessionIdValid() boolean flag at the begining of the execute method.
The false value throws an Exception that can be caught and forward the user to a particular JSP with the right error message.
Works fine for me.
What do you think ? Does it make sense to you, Struts experts ?
I agree. Here's the link: http://aspose.com/file-tools
subject: How to properly handle server Timeout ?
Similar Threads
Connection pool InactiveconnectionTimeout value
File Upload
error in running JSP in WebLogic server?
struts problem with weblogic
Way to display stack trace instead of 500 internal server error?