【发布时间】:2014-05-28 20:07:59
【问题描述】:
我正在从主要流程中调用子流程。我已经能够将对象ShareHolderProfile 从 MainFlow 传递给 SubFlow。但是,我不确定这个相同的对象是否没有被传递回 MainFlow,或者我没有在我的 JSP 中正确访问它。这是我的做法。
MainFlow.xml
<?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="retriveAccount">
<var name="acctProfile" class="com.abc.xyz.account.ShareHolderProfile"/>
<view-state id="retriveAccount" view="AccountView">
<transition on="Success" to="createAccountSubFlow"/>
</view-state>
<subflow-state id="createAccountSubFlow" subflow="createAccountSubFlow">
<input name="acctProfile" value="acctProfile"/>
<transition on="finish" to="showAlternateRoute"/>
</subflow-state>
<view-state id="showAlternateRoute" view="showAlternateView" model="acctProfile">
<on-entry>
<evaluate someExpression result="viewScope.SomeValue"/>
</on-entry>
<transition on="viewAction" to="accountDetails"/>
</view-state>
子流.xml
<?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="showAccount">
<input name="acctProfile" />
<view-state id="showAccount" view="randomView" model="acctProfile">
<on-entry>
<evaluate expression="SomExpression"/>
</on-entry>
<transition on="SomeEvent" to="NextState"/>
</view-state>
<view-state id="NextState" view="SomeRandomView" model="acctProfile">
<on-entry>
<evaluate expression="controller.Method(acctProfile)" result="viewScope.profileForm"/>
</on-entry>
<transition on="viewResult" to="finish"/>
</view-state>
<end-state id="finish" />
现在,在大多数情况下,应用程序中的流程运行良好。但是,问题是我一直在尝试从我的一个 jsp 中的 acctProfile 访问一些属性(成员变量)。类似的东西 - acctProfile.FirstName
但是,我无法做到这一点。 acctProfile 对象是没有从 subFlow 传递到 Mainflow 还是我在 JSP 中错误地使用它。请指教。
提前致谢
【问题讨论】:
标签: java spring-webflow