2010-05-20 78 views
0

我是Spring webflow的新手,现在我正在尝试Spring食谱书中的示例,并且我知道这是一个基本问题。找不到流程定义。 Spring web flow

我收到错误如下,

org.springframework.webflow.definition.registry.NoSuchFlowDefinitionException: No flow definition '${flowExecutionUrl}&_eventId=next' found 
    at org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl.getFlowDefinitionHolder(FlowDefinitionRegistryImpl.java:126) 
    at org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl.getFlowDefinition(FlowDefinitionRegistryImpl.java:61) 
    at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:138) 
    at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:193).... 

下面显示的是我的配置,

<bean name="flowController" class="org.springframework.webflow.mvc.servlet.FlowController"> 
     <property name="flowExecutor" ref="flowExecutor"></property> 
    </bean> 

    <webflow:flow-executor id="flowExecutor" /> 

    <webflow:flow-registry id="flowRegistry" > 
     <webflow:flow-location path="/WEB-INF/flows/welcome/welcome.xml"></webflow:flow-location> 
    </webflow:flow-registry> 

/WEB-INF/flows/welcome/welcome.xml,

<view-state id="welcome"> 
    <transition on="next" to="introduction" /> 
    <transition on="skip" to="menu" /> 
</view-state> 

<view-state id="introduction"> 
    <on-render> 
     <evaluate expression="libraryService.getHolidays()" result="requestScope.holidays" /> 
    </on-render> 
    <transition on="next" to="menu" /> 
</view-state> 

<view-state id="menu"></view-state> 

In welcome.jsp,

<a href="${flowExecutionUrl}&_eventId=next">Next</a> 
    <a href="${flowExecutionUrl}&_eventId=skip">Skip</a> 

请让我知道发生了什么问题。我正在使用2.0.9版本。

由于提前, SD

回答

0

你作为你已经进入了welcome流,但你没有。尝试在项目中创建的根index.html文件,并把以下链接有(用户手动输入您的应用程序)

<a href="welcome">Enter application</a> 

...或操作,导航自动将您的流程:

<html> 
<head> 
    <meta http-equiv="Refresh" content="0; URL=spring/welcome"/> 
</head> 
</html> 

...其中spring是你的Spring MVC的调度程序的URL模式在web.xml(可以说

<servlet> 
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> 
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
    <init-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value></param-value> 
    </init-param> 
    <load-on-startup>2</load-on-startup> 
</servlet> 

<!-- Map all /spring requests to the Dispatcher Servlet for handling --> 
<servlet-mapping> 
    <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> 
    <url-pattern>/spring/*</url-pattern> 
</servlet-mapping> 
0

貌似的$值{} flowExecutionKey不人口稠密。试试这个

<c:out value='${flowExecutionKey}'/> 

这样的welcome.jsp看起来像

<a href="<c:out value='${flowExecutionKey}'/>&_eventId=next">Next</a><a href="<c:out value='${flowExecutionKey}'/>&_eventId=skip">Skip</a>