views:

267

answers:

1

Hi,

I am new to Spring webflow and now I am trying the example in Spring recipes book and I know this is a basic question.

I am getting the error as follows,

    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)....  

Shown below is my configurations,

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

Please let me know what is going wrong. I am using 2.0.9 Release.

Thanks in advance, SD

A: 

You act as you had entered the welcome flow, but you haven't. Try to create index.html file in the root of your project and put the following link there (for user to manually enter your app)

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

... or following to navigate to your flow automatically:

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

... where spring is the url pattern of your Spring MVC Dispatcher Servlet in your web.xml (lets say

<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>
denis_k