當我進行表單提交時,我想發(fā)送簡單的布爾值。我不想為視圖狀態(tài)創(chuàng)建特殊模型。所以我的問題是,我可以在沒有模型的情況下傳遞值,因為它是使用 spring webflow 的簡單單值。還是我必須創(chuàng)建模型?
1 回答

嚕嚕噠
TA貢獻1784條經(jīng)驗 獲得超7個贊
您可以在視圖中簡單地使用它myView:
<form:form action="${flowExecutionUrl}">
<input type="checkbox" id="booleanValue" name="booleanValue"/>
<input type="submit" id="submit" name="_eventId_submitValue" value="Submit"/>
</form:form>
在你的流程中:
<view-state id="myView">
<transition on="submitValue">
<set name="myBooleanValue" value="requestParameters['booleanValue']"/>
<!-- do something with your value -->
</transition>
</view-state>
請注意,<input type="checkbox"/>只有選中(“on”)才會發(fā)送一個值
添加回答
舉報
0/150
提交
取消