我使用Spring Web Flow的2时遇到让我过渡到适当火的一个基本问题。 我已经做了很多在互联网上搜索,并一直未能找到的转变是如何从观察侧引发了深入的解释。 我有两种状态:enterBookingDetails和reviewBooking。 EnterBookingDetails工作正常 - 网页载入和提交事件,reviewBooking被加载。 我的问题是,我无法从reviewBooking工作得到任何的转换。 以下是我有:
预订-flow.xml:
<var name="bookingForm" class="com.mypackage.CarBookingForm"/>
<view-state id="enterBookingDetails" model="bookingForm">
<transition on="submit" to="reviewBooking" />
</view-state>
<view-state id="reviewBooking" model="bookingForm">
<transition on="confirm" to="bookingConfirmed" />
<transition on="revise" to="enterBookingDetails" />
<transition on="cancel" to="bookingCancelled" />
</view-state>
<end-state id="bookingConfirmed" />
<end-state id="bookingCancelled" />
enterBookingDetails.jsp(摘录):
<form:form modelAttribute="bookingForm">
Pickup: <form:input path="pickUpLocation"/><br />
Dropoff: <form:input path="dropOffLocation"/><br />
<input type="submit" name="_eventId_submit" value="Confirm"/>
<input type="submit" name="_eventId_other" value="Other"/>
</form:form>
reviewBooking.jsp(摘录):
Pickup Loc: ${bookingForm.pickUpLocation}<br />
Dropoff Loc: ${bookingForm.dropOffLocation}<br />
<form>
<input type="submit" name="_eventId_confirm" value="Confirm" />
<input type="submit" name="_eventId_revise" value="Revise" />
<button type="submit" name="_eventId_cancel">Cancel</button>
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}" />
</form>
当任一按钮被点击了“reviewBooking”,用户被引导返回到“enterBookingDetails”与无填充形式的数据。 在此先感谢您的帮助。