Hi,

I am trying to handle session timeout by extending the ActionServlet.

I am trying to use the request method isRequestedSessionIdValid() coupled with checking the session for my userbean.

Please comment about this code. Advice if there is a better way to do session timeout trapping.

/******************************************************************************/

 public boolean processPreprocess(HttpServletRequest request,  HttpServletResponse response)
 {

   /* "UserBean" is a bean which represents the logged in user. */ 
  if( request.isRequestedSessionIdValid() || request.getSession().getAttribute("UserBean") != null)
       return true;
  else
  {
   try
   {
    request.getRequestDispatcher("SessionTimeout.do").forward(request,response);
   }
   catch(Exception e)
   {
          e.printStackTrace();  
   }
   return false;
  }
 }

/******************************************************************************/

Regards,
Sanoj Antony

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to