我有一个主流,它是来自index.jsp的链接,它是链接到子流的测试应用程序的入口点。主流是main-flow.xml,并在使用class="org.springframework.webflow.mvc.servlet.FlowController".的bean声明中映射到main.htm
在主流视图中,有链接Systeme suchen
链接到子流的。
在子流中,我有以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"
start-state="Search">
<view-state id="Search" view="/Search" >
<transition on="proceed" to="temp" />
<transition on="cancel" to="SubEnd" />
</view-state>
<view-state id="temp" view="/End" />
<view-state id="SubEnde" view="/Start" />
</flow>Search的视图现在不包含任何逻辑,只包含一个链接和一个按钮。用于End.jsp的JSP确实只包含一些传说中的ipsum静态内容,而Start与主流使用的视图相同。
Search.jsp链接和按钮:
这是可行的:
<a href="main.htm?_flowExecutionKey=${flowExecutionKey}&_eventId=proceed">
<span>Proceed Link</span></a>这不会,只会显示“描述请求的资源不可用”。站点:
<a href="${flowExecutionKey}&_eventId=proceed">
<span>Proceed Link 2</span></a>
<a href=_eventId=proceed">
<span>Proceed Link 3</span></a>这个按钮并不能做任何事情:
<input type="submit" value="Proceeding" name="_eventId_proceed" id="eventId_proceedButton1">这里出了什么问题?我在互联网上看到过很多这样指定按钮的例子。我是不是缺少一些按钮的配置?
发布于 2014-05-19 16:31:02
如果你使用的是按钮,你需要通过jquery或javascript来完成。类似于单击按钮的事件执行以下操作:
document.getElementById('<yourFormName>').action = '${flowExecutionUrl}&_eventId=<yourEventID>';
document.getElementById('<yourFormName>').submit();这可能会对你有帮助。
发布于 2014-07-14 00:45:38
您应该添加隐藏字段以保持SnapShot变量(表示localhost:8080/yourappcontext/yourpage?execution=e1s1).在上面的url中,e1s1是SnapShot变量的值。所以在你的例子中:
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}"/>
<input type="submit" value="Proceeding" name="_eventId_proceed"/>但是这两个标签都应该留在表单标签中。
https://stackoverflow.com/questions/23731948
复制相似问题