Hi 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..
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.
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 ?
Attractive, successful people love this tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads