2011-03-28 78 views
0

我不知道這是否可能在一個Webflow 2.2.1將var分配給視圖狀態?

flow.xml

<view-state id="flowId1" model="flowModel1" view="/WEB-INF/templates/Flow_Form/form1.jsp"> 
    <set attribute="strVar" value="${'someStringVar'}" />  
    <transition on="step1" to="step1Action" /> 
</view-state> 

JSP

<h1>${strVar}</h1> 

從本質上講,我想分配將在個別視圖狀態之間更改值的字符串變量,該變量在flow.xml中設置..

有沒有其他簡單的推薦方法呢?

感謝

回答

0

得到它.. :)

<view-state id="flowId1" model="flowModel1" view="/WEB-INF/templates/Flow_Form/form1.jsp"> 
    <on-entry> 
      <evaluate expression="'someStringVar'" result="flowScope.strVar"/> 
     </on-entry>  
    <transition on="step1" to="step1Action" /> 
</view-state>