Hi,
I dont know if is a good design or exists other best practices for
this scenario but that i have done is put a session attribute and test
in my
base action about it.
(sorry by my english)
bye, pablo.
-Mensaje original-
De: Franz-Josef Herpers [mailto:[EMAIL PROTECTED]
Enviado el: MiƩrcoles, 06 de Julio de 2005 10:03 a.m.
Para: Struts Users Mailing List
Asunto: Redirect request to home if session is expired
Hi list members,
in my Struts-based application I want to test, if the session of the
user is expired. If so, I want to forward/redirect the user back to the
starting page. But this seems to be a problem, if I call an Action that
is associated with an ActionForm in session scope. When I tried to test
for an expired session with request.getSession(false) the session is
never null, even if I monitor session destruction with a SessionListener
and can be sure the session is destroyed. As the source code of
RequestProcessor suggests, this is because a new session is created, if
the old is expired to put the ActionForm in this session. To get around
this situation I associated the ActionServlet with a filter and did the
testing for expired sessions there. This works. My remaining question
is: Is this in any way a bad design or exists other best practices for
this scenario? I'm surely not the only one who ran into this
Thanks in advance for any hints.
Regards
Franz
-
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]