How to pass parameters to spring webflow

谁都会走 提交于 2019-12-06 06:00:58

问题


I am working on spring webflows. I have two webflows in my application, one to add a person details and one to modify the person details. Both flows are working fine. Now I would like to pass parameter(s) to my modify flow and access it, so that I can preselect some of the values based on the passed parameter. How can I achieve it for below mentioned scenarios?

  1. From the Add flow end state.
  2. From outside the flow i.e from anywhere in the application except add flow.

回答1:


I figured it out. In the end it was very simple and i just had to pass the parameters in url and get the parameters that I pass using input tag in the flow.xml. Earlier i wasn't using the input tag.

Url will be something like ths

http://localhost:8080/modifyPerson?personName=xxx

Then in flow.xml personName parameter that is passed is retrieved using input tag and set to the model.

 <input name="personName"/>

 <view-state id="modifyBasics" view="modifyBasics" model = "person">
    <on-render>
        <set name="person.personName" value="personName"></set>
    </on-render>
    ....
 </view-state>


来源:https://stackoverflow.com/questions/24008043/how-to-pass-parameters-to-spring-webflow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!