Hi Tony.

"Tony Li" <[EMAIL PROTECTED]> writes:

> What's the most elegant way of redirecting the user to the login page
> after his session expires within struts?

Here's a simple approach:

Override the ActionServlet's perform method to check the session for
something that your login action should've put there.  If it's there,
return super.perform().  If it's not, return findForward("login"),
assuming you have a global forward in your struts-config called
"login". 

A more elegant approach might involve the use of a filter (Servlet
2.3) instead of an ActionServlet derivation, but the idea of "looking
in the session for something indicating a successful login" is the
same.

-- 
Jim Crossley
http://www.lads.com/~jim

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

Reply via email to