On 19 Mar 2004, at 10:48, Sanoj, Antony (IE10) wrote:
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,r esponse);
���}
���catch(Exception e)
���{
��������� e.printStackTrace();��
���}
���return false;
��}
�}
/ *********************************************************************** *******/
Regards, Sanoj Antony --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

