spring - spring webflow中无效的_eventId

标签 spring spring-mvc spring-webflow-2 event-id

有什么方法可以处理 Spring Webflow 中不存在的 eventId 或缺少 eventId 参数吗?

例如对于这个网络流

<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="welcome">
        <transition on="goForward" to="nextStep"/>
    </view-state>
    <view-state id="nextStep">
        <transition on="endFlow" to="finishStep" />
    </view-state>
    <end-state id="finishStep"/>    
    <global-transitions>
        <transition on="cancel" to="finishStep"/>
    </global-transitions>
</flow>

如何处理带有 _eventId=unexistingAction 等参数的请求或不带有 _eventId 参数的请求? 这通常会生成一个带有堆栈跟踪的页面...

no transition found on occurence of event in state of flow...

最佳答案

这是处理不存在的转换的方法:

<global-transitions>
    <transition on-exception="org.springframework.webflow.engine.NoMatchingTransitionException" to="handlingViewState">
        <evaluate expression="handlingBean.handle(flowExecutionException)"></evaluate>
    </transition>
</global-transitions>

关于spring - spring webflow中无效的_eventId,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18432059/

相关文章:

java - 传递的分离实体与 LatLng 列表一起保存

java - 单元测试嵌套子流(子流的子流)

java - 如何扩展 Spring 容器以实现特定于部署?

javascript - 将简单数组传递给 Java Spring

java - Spring Security - 从另一个表获取用户详细信息

java - Spring Controller 注册了两次

java - Spring Web Flow - 如何使用 conversationScope 中已有的值设置单元测试?

java - Spring Web Flow 转换未触发

spring - 具有自定义响应 header 的响应式(Reactive)文件 Controller

spring - 如何将 detectorHandlerMethodsInAncestorContexts 设置为 true?