【问题标题】:spring web flow transition on attribute属性上的spring web flow转换
【发布时间】:2015-01-22 14:46:53
【问题描述】:

我尝试了解 Spring Web Flow 的工作原理。我知道。我在单独的 file.xml 中创建了一个流程,流程定义如下:

<?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">

   <view-state id="hello" view="/jsp/smp/wzory/wzory">
       <transition on="next" to="nextView"/>
   </view-state>

   <end-state id="nextView" view="/jsp/smp/wzory/next"/>

这里我有两个观点

  • 你好(/jsp/smp/wzory/wzory.jsp)
  • nextView (/jsp/smp/wzory/next.jsp)

现在我想从视图 hello 转到查看 nextView。这个操作我想在点击超链接 a href="" 后触发 但是这个表达式是什么意思

  transition on="next"

这到底是什么,在什么上?

http://localhost:8080/next
 <a href="http://localhost:8080/next"

或者必须将某些变量传递给超链接以通知 spring webflow 进入下一个视图状态?

 <a href="http://localhost:8080/somePage?on=next"

【问题讨论】:

    标签: java spring jsp spring-mvc


    【解决方案1】:

    oneventId 请参见下面的示例(它是 Spring Web Flow 和 Thymeleaf 代码)

    <a th:href="@{${flowExecutionUrl}(_eventId='next')}">Next page</a>
    

    别忘了flowExecutionUrl

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-30
      • 2012-03-20
      • 1970-01-01
      相关资源
      最近更新 更多