2010-05-20 81 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>