Results 1 to 5 of 5

Thread: Accessing Current State ID from JSP

  1. #1
    Join Date
    Feb 2008
    Posts
    3

    Default Accessing Current State ID from JSP

    Hi Folks,

    I'm wondering if it is somehow possible to access the current state's name from the view (JSP).

    Right now what I'm doing to make this possible is following:
    Code:
       <render-actions>
    	<evaluate-action expression="${currentState.id}">
    	       <evaluation-result name="currentState" scope="flow"/>
    	</evaluate-action>
       </render-actions>
    That allows me to access my currentState variable from the view. The question is, is there a more direct way?


    Thanks,

    Klaus.

  2. #2
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    Try this:

    Code:
    <c:out value="${flowExecutionContext.activeSession.state.id}"/>
    The FlowExecutionContext is exposed to the views as "flowExecutionContext".

    Erwin

  3. #3
    Join Date
    Feb 2008
    Posts
    3

    Default Great!

    Thank you very much; that's exactly what i needed.

  4. #4
    Join Date
    Dec 2008
    Posts
    1

    Default

    Thank you, I'm looking for it too

  5. #5

    Unhappy FlowExecutionContext is null

    Quote Originally Posted by klr8 View Post
    Try this:

    Code:
    <c:out value="${flowExecutionContext.activeSession.state.id}"/>
    The FlowExecutionContext is exposed to the views as "flowExecutionContext".

    Erwin
    I tried to get the state ID of the view State in my jsp using ${flowExecutionContext.activeSession.state.id}. It was giving me a blank output.

    When i tried to debug more I found out that ${flowExecutionContext} was empty or null. Can i get some pointer on this. At this moment, I am achiving this by setting parameters in web flow, but it is completely not acceptable to work with the redundancy.

    Please advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •