« Return to Thread: Transfer user to login page on session timeout

Re: Transfer user to login page on session timeout

by Vivek Rana :: Rate this Message:

Reply to Author | View in Thread

Hi,

You should be able to use servlet filters to block the request from
going to the actions:  http://java.sun.com/products/servlet/Filters.html

I would do it your way and check for timeout by checking for the
presence of session objects.  There may be better ways, but I can't
think of any other.  (A different way may be to check whether the
session was started in this request.  I don't know how to do it in
struts though and I don't see a reason why it would actually be
advantageous to use that check.)

-Vivek.


bhaarat Sharma wrote:

> Hello
>
> I am using struts 1
>
> I am working on some legacy code. Have a requirement where the user should
> be fwded to the login page after session times out.  Currently there are
> 100's of action classes and it wont be feasible to touch each one and check
> if the session exists.
>
> Can we do something in struts 1 so that all requests go through the initial
> action...there I can check for session object..if it does not exist then I
> can forward it to the login page.
>
> Thanks for any help!!
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...

 « Return to Thread: Transfer user to login page on session timeout