I am of the opinion that this is too specific a situation for a framework to take over. I really get irritated when frameworks plug in stuff that should be taken care of at the application level. I do think that making code available for people that want a prepackaged solution in a "plugin" or "application" area relating to a framework makes sense. I have beaten this drum to death on this list, however, with no positive response. As things are with Struts, many application specific matters are covered (Struts upload, the "dispatch" Action subclssses, etc.) but most (shopping cart, etc) are not. I wish there were a set of policies and procedures on this, but just get the usual rigamoroles when a discussion on this is attempted. I sure would not want the framework to put something in on this, like with file uploads, that we would then have to work around.
On 5/23/05, Frank Ratzlow <[EMAIL PROTECTED]> wrote: > 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 <[EMAIL PROTECTED]> > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- "You can lead a horse to water but you cannot make it float on its back." ~Dakota Jack~ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]