当我提交表单时,我想发送简单的 boolean 值。 我不想在 View 状态下创建特殊模型。
所以我的问题是,我可以在没有模型的情况下传递值吗,因为它是使用 spring webflow 的简单单个值。或者我必须创建模型吗?
最佳答案
你可以简单地在你的 View 中使用这个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”)时才发送值
关于java - 如何将简单值表单ui表单传递给spring webflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55747405/