If your container supports it use a Filter. And I think (perhaps don't know) that session timeout is something you usually configure the container to do, but again i'm not sure of your requirement.



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]



Reply via email to