将参数从JSF发送到Webflow转换

时间:2011-10-13 13:19:39

标签: jsf spring-webflow

基本上我现在拥有的是:

<view-state id="pageOne" view="pageone.xhtml">
    <transition on="gotoPageTwo" to="doGotoPageTwo" />
</view-state>
<subflow-state id="doGotoPageTwo" subflow="pageTwo">
    <transition on="return" to="pageOne" />
</subflow-state>

JSF代码为:

<h:commandLink value="Page Two" action="gotoPageTwo" />

到目前为止一切顺利。我接下来要做的是类似于:

<h:commandLink value="Page Two" action="gotoPageTwo(customArgument)" />

<view-state id="pageOne" view="pageone.xhtml">
    <transition on="gotoPageTwo" to="doGotoPageTwo" />
</view-state>
<subflow-state id="doGotoPageTwo" subflow="pageTwo">
    <input name="myCustomArgument" value="customArgument" />
    <transition on="return" to="pageOne" />
</subflow-state>

我知道这显然不能正常工作,但希望你能得到这个概念。我发现的唯一解决方案是使用actionListener将数据放入某种伪全局变量(在链接bean或flash- / flow-Scope中)。这似乎是一个丑陋的解耦解决方案,与将参数放在全局变量而不是在c ++中传递它们没有多大区别。有没有更好的方法呢?

聚苯乙烯。我们也使用Primefaces,但我不认为这种情况与此相关。

0 个答案:

没有答案