It seems that your session is getting killed when you navigate to another site and subsequently when you try to invalidate the session it is giving an error since session is already killed. May be you should check for the existence of session and then if the session exists then only try to invalidate the session.
Milind -----Original Message----- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 5:31 PM To: Struts Users Mailing List Subject: Re: session.invalidate() throws exception. Then index.jsp is to be mapped to an action in web.xml. My situation is user goes to another site then returns to home page of our application. rgds Antony Paul. ----- Original Message ----- From: "Raman Garg" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, December 10, 2003 5:05 PM Subject: Re: session.invalidate() throws exception. > Hello Antony > > Here is a sample of code, hopes this solves your problem... > > public ActionForward execute(ActionMapping mapping, > ActionForm form, > HttpServletRequest request, > HttpServletResponse response) throws > Exception { > > // Extract attributes and/or parameters we will need > Locale locale = getLocale(request); > MessageResources messages = getResources(request); > HttpSession session = request.getSession(); > > // Get already logged user info from session scope // **** We have a > Customer Bean in session > Customer customer = (Customer)session.getAttribute(USER_KEY); > > // If customer has not logged in, return control to User Login view > with > // that reason. > if (customer == null) { > return new ActionForward("/Login.do?reason=" + > LOGIN_REASON_NOT_LOGGED_IN, true); > } > } > > > -- Raman > ----- Original Message ----- > From: "Antony Paul" <[EMAIL PROTECTED]> > To: "struts" <[EMAIL PROTECTED]> > Sent: Wednesday, December 10, 2003 5:08 PM > Subject: session.invalidate() throws exception. > > > > Hi, > > Calling session.invalidate() in index.jsp throws this exception > > java.lang.IllegalStateException: getAttribute: Session already invalidated > > at > > > org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav > > a:954) > > at > > > org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi > > onFacade.java:171) > > at org.apache.struts.taglib.html.FormTag.renderToken(FormTag.java:641) > > at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:513) > > at org.apache.jsp.index_jsp._jspService(index_jsp.java:97) > > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) > > > > How to change this behavior. Better if possible to do some house keeping > > before invalidating session like if a valid session and data is present in > > > session then go to a certain page. > > > > rgds > > Antony Paul. > > > > > > > > --------------------------------------------------------------------- > > 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] > > --------------------------------------------------------------------- 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]

