这个查询是关于在spring-webflow中将一个流范围变量从一个视图状态传递到另一个视图状态。
下面的代码是一个flow.xml文件。1.我在这个文件中有两个视图状态(‘firstView’,'secondView')。3.在“firstView”视图状态中定义了一个转换“selectUsers”,它调用另一个视图状态“secondView”。5.请告诉我如何将“customizeBean”从第一个视图状态传递到第二个视图状态。
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
start-state="firstView" parent="reportStandard" >
<on-start>
<set name="flowScope.customizeBean" value="customizeBean" />
</on-start>
<view-state id="firstView" view="customizeReport.xhtml">
<transition on="selectUsers" to="secondView" />
</view-state>
<view-state id="secondView"
view="/WEB-INF/twinPickers.xhtml">
<on-entry>
<evaluate expression="reportAction.createTwinPicker" />
</on-entry>
</view-state>
<bean-import resource="customizeReport-bean.xml" />
</flow>发布于 2014-01-21 22:56:54
在流的生命周期中,流中的所有视图都可以使用存储在flowScope中的对象。您不必将它们从一个视图状态传递到另一个视图状态。您存储在flowScope中的对象是可序列化的吗?
http://docs.spring.io/spring-webflow/docs/2.3.2.RELEASE/reference/html/ch04s04.html#el-variable-flowScope
https://stackoverflow.com/questions/21200645
复制相似问题