未找到流定义。 Spring网络流

发布于 2024-09-02 08:06:20 字数 2018 浏览 7 评论 0原文

我是 Spring webflow 的新手,现在我正在尝试 Spring 食谱书中的示例,我知道这是一个基本问题。

我收到如下错误,

    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>  

在welcome.jsp中,

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

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

提前致谢, 标清

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

内心旳酸楚 2024-09-09 08:06:20

您的行为就像您已进入欢迎流程,但实际上您并没有。尝试在项目的根目录中创建index.html文件,并将以下链接放在那里(供用户手动输入您的应用程序)

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

.​​..或以下链接自动导航到您的流程:

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

...其中spring 是 web.xml 中 Spring MVC Dispatcher Servlet 的 url 模式(可以说

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

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>
他夏了夏天 2024-09-09 08:06:20

看起来 ${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>  

Looks like the values of ${flowExecutionKey} is not getting populated. Try this

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

so welcome.jsp will look like

<a href="<c:out value='${flowExecutionKey}'/>&_eventId=next">Next</a><a href="<c:out value='${flowExecutionKey}'/>&_eventId=skip">Skip</a>  
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文