Announcement Announcement Module
Collapse
No announcement yet.
How to get HttpSession in the flow?? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to get HttpSession in the flow??

    Hi

    I was facing a problem, I want to get the HttpSession/the session id while I am within the flow. I checked around all the different scopes in the flow, it didn't seem give me any accessability to get the HttpSession.


    Thanks,

    Last edited by jackura; Jan 11th, 2010, 08:29 AM.

  • #2
    something like the following should work.

    Code:
    externalContext.nativeRequest.session.id

    Comment


    • #3
      Originally posted by Marten Deinum View Post
      something like the following should work.

      Code:
      externalContext.nativeRequest.session.id
      thanks

      in your flow
      Code:
      <evaluate expression="xxxService(flowRequestContext)"/>
      and then in the code
      Code:
      xxxService(RequestContext context)

      Comment


      • #4
        I've implemented Action in order to access the HttpSession:

        Code:
        public class LogoutAction implements Action {
        	
        	public Event execute(RequestContext context) throws Exception {
        		ServletExternalContext externalContext = (ServletExternalContext) context.getExternalContext();
        		HttpSession session = ((HttpServletRequest) externalContext.getNativeRequest()).getSession();
        		...
        		return null;
        	}
        	
        }
        then executed it:

        Code:
        <evaluate expression="logoutAction" />

        Comment

        Working...
        X