如何将参数传递给Spring Webflow [英] How to pass parameters to spring webflow

查看:258
本文介绍了如何将参数传递给Spring Webflow的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理Spring Webflow.我的应用程序中有两个Webflow,一个用于添加人员详细信息,另一个用于修改人员详细信息.两种流程都工作正常.现在,我想将参数传递给我的修改流程并访问它,以便我可以根据传递的参数预先选择一些值.在以下提到的情况下如何实现?

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. 从添加流结束"状态开始.
  2. 从流程外部,即从应用程序中除添加流程以外的任何地方.

推荐答案

我知道了.最后,它非常简单,我只需要在url中传递参数并使用flow.xml中的输入标签获取传递的参数.早些时候我没有使用输入标签.

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.

网址将类似于此

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

然后在flow.xml中使用输入标签检索所传递的personName参数,并将其设置为模型.

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>

这篇关于如何将参数传递给Spring Webflow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆