简单页面流的处理

<?xml version="1.0" encoding="UTF-8"?>

<flow>

<!-- 输入测试 -->

<input name="hotelId" value="flowScope.hotelId"/>

<!--变量测试 -->

<var name="searchCriteria" class="org.springframework.webflow.samples.booking.SearchCriteria" />

<on-start>

<transition to="checkDate" name="检查日期"/>

</on-start>

<decision-state id="checkDate">

<if test="{@flowManager.checkDate(#p)}" then="main" else = "notstart"/>

</decision-state>

<view-state id="main" view="/flow/main">

<transition on="confirm"  to="bookingConfirmed" />

<transition on="cancle"   to="cancel" />

<transition on="getCode"   to="getCode" />

</view-state>

<!--ajax 测试-->

<view-state id="getCode" view="/flow/getCode.do" ajax="true"></view-state>

<!--上传测试 -->

<view-state id="upload" view="/flow/upload" ></view-state>

<!-- 后台动作测试 -->

 <action-state id="saveOrder">

<evaluate expression="{@bookingService.findBookings(#currentUser.name)}" result="flowScope.bookings" result-type="dataModel" />

<transition on="book" to="bookHotel" />

 </action-state>

<end-state id="bookingConfirmed" view="/flow/confirm"></end-state>

<end-state id="cancel" view="/flow/cancle"/>

</flow>

流定义文件如上,需要处理几种情况:

1  页面跳转

2 输入值的处理

3 后台程序的处理

猜你喜欢

转载自guanxi.iteye.com/blog/2396183