Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring Flow: Pass object back and forth from between Main WebFlow and Subflow
    text
    copied!<p>I am calling a subflow from a main flow. I have been able to pass an object <code>ShareHolderProfile</code> to the SubFlow from the MainFlow. However, I am not sure if this same object is not being passed back to the MainFlow or I am not properly accessing it in my JSP. Here is how I am doing it. </p> <h1>MainFlow.xml</h1> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;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"&gt; &lt;var name="acctProfile" class="com.abc.xyz.account.ShareHolderProfile"/&gt; &lt;view-state id="retriveAccount" view="AccountView"&gt; &lt;transition on="Success" to="createAccountSubFlow"/&gt; &lt;/view-state&gt; &lt;subflow-state id="createAccountSubFlow" subflow="createAccountSubFlow"&gt; &lt;input name="acctProfile" value="acctProfile"/&gt; &lt;transition on="finish" to="showAlternateRoute"/&gt; &lt;/subflow-state&gt; &lt;view-state id="showAlternateRoute" view="showAlternateView" model="acctProfile"&gt; &lt;on-entry&gt; &lt;evaluate someExpression result="viewScope.SomeValue"/&gt; &lt;/on-entry&gt; &lt;transition on="viewAction" to="accountDetails"/&gt; &lt;/view-state&gt; </code></pre> <h1>SubFlow.xml</h1> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;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"&gt; &lt;input name="acctProfile" /&gt; &lt;view-state id="showAccount" view="randomView" model="acctProfile"&gt; &lt;on-entry&gt; &lt;evaluate expression="SomExpression"/&gt; &lt;/on-entry&gt; &lt;transition on="SomeEvent" to="NextState"/&gt; &lt;/view-state&gt; &lt;view-state id="NextState" view="SomeRandomView" model="acctProfile"&gt; &lt;on-entry&gt; &lt;evaluate expression="controller.Method(acctProfile)" result="viewScope.profileForm"/&gt; &lt;/on-entry&gt; &lt;transition on="viewResult" to="finish"/&gt; &lt;/view-state&gt; &lt;end-state id="finish" /&gt; </code></pre> <p>Now, for the most part, the flows in the applications works fine. However, the problem is that I have been trying to access some attributes (Member variable) from acctProfile in one of my jsp . Something like - acctProfile.FirstName</p> <p>However, I am not able to do this. Is the acctProfile object not being passes from the subFlow to Mainflow or am I using it incorrectly in the JSP. Please advise. </p> <p>Thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload