voyent
invalidating the current HttpSession problem  XML
Forum Index -> General Help
Author Message
Andreh

Joined: 11/Dec/2006 00:00:00
Messages: 33
Offline


Hi,

right now I'm facing a little problem... here I try to invalidate the whole HttpSession (and after forwarding to another page).

the relevant code:

Code:
      FacesContext context = FacesContext.getCurrentInstance();
      HttpSession session = (HttpSession) context.getExternalContext().getSession(true);
             session.invalidate();
 


then, BlockingServlet throws this Exception:

Code:
 17:19:35,265 ERROR [[Blocking Servlet]] Servlet.service() for servlet Blocking Servlet threw exception
 java.lang.IllegalStateException: getAttribute: Session already invalidated
         at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1011)
         at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:109)
         at com.icesoft.faces.context.SessionMap.getAttribute(SessionMap.java:53)
         at com.icesoft.faces.context.AbstractAttributeMap.get(AbstractAttributeMap.java:149)
         at org.apache.myfaces.portlet.PortletUtil.isPortletRequest(PortletUtil.java:45)
         at org.apache.myfaces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:81)
         at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:84)
         at javax.faces.component.UICommand.broadcast(UICommand.java:106)
         at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
         at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
         at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
         at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.renderCycle(BlockingServlet.java:456)


So, what can I do to resolve this?

Sorry if this is already on JIRA...
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


Hi,

You can't navigate in JSF after invalidating the session, because Navigation requires session attributes. Take a look at this post for a workaround: http://www.icefaces.org/JForum/posts/list/3111.page

Philip

.
Andreh

Joined: 11/Dec/2006 00:00:00
Messages: 33
Offline


Hi, philip

thanks, this workaround helped me to solve my problem =]
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team