如何在Spring Web流程中成功从动作状态重定向到查看状态

时间:2014-11-04 08:04:37

标签: spring

如何在Spring Web流程中成功从动作状态重定向到视图状态。

1 个答案:

答案 0 :(得分:0)

喜欢这个。见http://docs.spring.io/spring-webflow/docs/current/reference/html/actions.html

<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

    <var name="taskId" class="java.lang.String" />

    <action-state id="myAction">
        <evaluate expression="taskId!=null" />
        <transition on="no" to="task_unavailable" />
        <transition on="yes" to="task_detail" />
    </action-state>

    <view-state id="task_detail" view="task_detail.xhtml" />

    <end-state id="task_unavailable" view="task_unavailable" />

</flow>