struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Ratzlow <ratz...@adesso.de>
Subject Antwort: Re: Antwort: RE: howto redirect to login site after session expiration?
Date Mon, 23 May 2005 15:00:42 GMT
Hi,

okay, but this leads to a solution where I do have to ensure a manuell 
redirect to the appropriate site by tracking session attributes. I thought 
that the container is maintaining a list of expired sessions (or at least 
valid sessions to figure out invalid sessions), so that I can _configure_ 
(web.xml sounds like a good place) what to do in the case of an expired 
session, means a session id stored in this list.
The problem with the NPE is a general prob that applies to all use cases 
where the user leaves some input site open in the browser and tries to 
submit it after the session timed out. The Struts framework finds no bean 
with bean with the formname specified in <html:form ...> in the newly 
created session so it creates a new one. Afterwards it tries to populate 
the bean but the new ActionForm isn't initialized yet (object graph) so 
all access to nested properties will result in a failure.

However, checking and handling expired session is IMHO very low level 
stuff the container should do for me. Isn't it?

Regards

Frank



Andrew Thorell <drew.thorell@gmail.com> 
23.05.2005 16:03
Bitte antworten an
"Struts Users Mailing List" <user@struts.apache.org>


An
Struts Users Mailing List <user@struts.apache.org>
Kopie

Thema
Re: Antwort: RE: howto redirect to login site after session expiration?






This is what I use...

<logic:present ...>
    -- main body here --
</logic:present>
<logic:notPresent name=...>
<logic:redirect ...>
</logic:notPresent>

Now if you're talking about the person filled out the form (or
whatever) and then let the session expire..  The first thing I would
check in the Validate Method would be to see if the session attribute
I put there when logging in was actually there. As for the NPE, I
debug based on trial and error sometimes and since I don't have your
full logic flow I can't give you a for certain answer, just
suggestions.


if ( request.getAttribute(" ") == null) //not sure what getAttribute
returns if nothing is there.
{
    mapping.findForward("expired");
}


Hope this helps,


Andrew

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



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message