Spring Webflow: No actions were executed

对着背影说爱祢 提交于 2020-01-07 04:36:50

问题


I'm trying to implement an Action in SWF but I get the same error even in the simplest example.

Error: "java.lang.IllegalStateException: No actions were executed, thus I cannot execute any state transition"

import org.springframework.webflow.execution.Action;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;

public class HelloAction implements Action {
@Override
public Event execute(RequestContext rc) throws Exception {                
    return new Event(this, "success");
}

I've declared the bean.

 <bean id="helloAction" class="app.action.HelloAction"/>

And in flow.xml..

<action-state id="intermedio">
   <action bean="helloAction"/>
   <transition on="success" to="fin"/>
</action-state>

<end-state id="fin" view="final" />

It works fine if I don't use "HelloAction". But if I want to use Action in SWF, I always get the previous error.

Is something else needed?

Thanks in advance.


回答1:


<action-state id="intermedio">
    <evaluate expression="helloAction.execute()">
    <transition on="success" to="fin"/>
</action-state>


来源:https://stackoverflow.com/questions/15575717/spring-webflow-no-actions-were-executed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!