Announcement Announcement Module
No announcement yet.
Forwarding to a view based on a request parameter Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Forwarding to a view based on a request parameter

    I have a need to render a different view based on the value of a request parameter. I am using the on-start tag to set up the objects and evaluating a service that populates the right model for the appropriate page, but then I want to go to the corresponding view from there. Do I use a transition within the on-start, or is there a better way? Each view defined after the on-start will have a different page associated with it.

  • #2
    I wouldn't handle it in the on-start section. Rather, you can either use a decision-state (preferred) or an action-state to evaluate the request parameter and transition to the appropriate view-state.


    • #3
      Here is a sample of what my flow configuration looks like. I want to be able to render a different jsp (JSF page) based on the sorId passed as a parameter. So far, this works to render the page, but it is only one view id. I need several others.

      	<input name="loginCode" type="string" />
      	<input name="accountId" type="string" />
      	<input name="sorId" type="string" />
      	<input name="deptId" type="string" />
         	    <set name="requestParmBean.loginCode" value="loginCode" />
         	    <set name="requestParmBean.accountId" value="accountId" />
         	    <set name="requestParmBean.sorId" value="sorId" />
         	    <set name="requestParmBean.deptId" value="deptId" />
             	<evaluate expression="riskForceController.setMessageContext(messageContext)" />
             	<evaluate expression="riskForceController.init(requestParmBean)" />
      	<view-state id="displayRiskForce"
      	<bean-import resource="riskforce-beans.xml" />