Moved Spring Web Flow to a top level project
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
# $Header$
|
||||
|
||||
# Contains filterable project settings. Setting placeholders in filterable project text
|
||||
# files will be replaced with these values when the 'statics' build target is run.
|
||||
#
|
||||
# You may add static settings directly to this source file in the format:
|
||||
# setting=value e.g MY_SETTING=myvalue
|
||||
# This is appropriate usage if you know the setting value will never change.
|
||||
#
|
||||
# At build time this source file is copied to the ${target.dir} where additional
|
||||
# dynamic settings may be appended using the <propertyfile> task. Use this approach
|
||||
# when a setting value depends on the build or the local user's environment.
|
||||
#
|
||||
# An example of this approach is shown below:
|
||||
#
|
||||
# build.xml
|
||||
# <target name="build.prepare" depends="common-targets.build.prepare">
|
||||
# <!-- Append additional local settings that are applicable to this project -->
|
||||
# <propertyfile file="${target.filter.file}">
|
||||
# <!-- key=the name of the setting
|
||||
# value=the property in your build.properties file that has the local setting value -->
|
||||
# <entry key="MY_LOCAL_SETTING" value="${my.local.setting}" />
|
||||
# </propertyfile>
|
||||
# </target>
|
||||
#
|
||||
# This allows for dynamic replacement values that are sourced from local properties files to facilitate
|
||||
# local user settings.
|
||||
#
|
||||
# To refer to filterable settings within project source files like config files, JSPs, or
|
||||
# other text files use the standard ant placeholder format:
|
||||
# @SETTING_NAME@ e.g, @MY_SETTING@ and @MY_LOCAL_SETTING@
|
||||
#
|
||||
# Your settings:
|
||||
@@ -0,0 +1,15 @@
|
||||
log4j.rootCategory=DEBUG, stdout, logfile
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
|
||||
|
||||
log4j.appender.logfile=org.apache.log4j.RollingFileAppender
|
||||
log4j.appender.logfile.File=@TEST_RESULTS_DIR@/@PROJECT_NAME@.log
|
||||
log4j.appender.logfile.MaxFileSize=512KB
|
||||
|
||||
# Keep three backup files
|
||||
log4j.appender.logfile.MaxBackupIndex=3
|
||||
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
|
||||
#Pattern to output : date priority [category] - <message>line_separator
|
||||
log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - <%m>%n
|
||||
@@ -0,0 +1,9 @@
|
||||
log4j.rootCategory=WARN, stdout
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
|
||||
|
||||
# Enable web flow logging
|
||||
log4j.category.org.springframework.webflow=DEBUG
|
||||
log4j.category.org.springframework.binding=DEBUG
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:flow="http://www.springframework.org/schema/webflow-config"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/webflow-config
|
||||
http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd">
|
||||
|
||||
<!--
|
||||
Exposes web flows for execution at a single request URL.
|
||||
The id of a flow to launch should be passed in by clients using
|
||||
the "_flowId" request parameter:
|
||||
e.g. /flowController.htm?_flowId=sampleA
|
||||
-->
|
||||
<bean name="/flowController.htm" class="org.springframework.webflow.executor.mvc.FlowController">
|
||||
<property name="flowExecutor" ref="flowExecutor" />
|
||||
</bean>
|
||||
|
||||
<!-- Launches new flow executions and resumes existing executions. -->
|
||||
<flow:executor id="flowExecutor" registry-ref="flowRegistry"/>
|
||||
|
||||
<!-- Creates the registry of flow definitions for this application -->
|
||||
<flow:registry id="flowRegistry">
|
||||
<flow:location path="/WEB-INF/sampleA.xml" />
|
||||
<flow:location path="/WEB-INF/sampleB.xml" />
|
||||
</flow:registry>
|
||||
|
||||
<!-- Resolves flow view names to .jsp templates -->
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="prefix" value="/WEB-INF/jsp/" />
|
||||
<property name="suffix" value=".jsp" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -0,0 +1,110 @@
|
||||
<%@ include file="includeTop.jsp" %>
|
||||
|
||||
<div id="content">
|
||||
Sample A Flow
|
||||
<hr>
|
||||
Flow input was: ${input}<br>
|
||||
<br>
|
||||
From Sample A you may terminate Sample A and launch Sample B from an end state of Sample A.
|
||||
You may also pass Sample B input. This can be done using:
|
||||
<ul>
|
||||
<table>
|
||||
<tr>
|
||||
<td>an anchor:</td>
|
||||
<td>
|
||||
<a href="<c:url value="/flowController.htm?_flowExecutionKey=${flowExecutionKey}&_eventId=end-A-and-launch-B&input=someInputForSampleB"/>">
|
||||
End Sample A and Launch Sample B
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">or a form:</td>
|
||||
<td>
|
||||
<table>
|
||||
<form action="flowController.htm" method="post">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="input" value="someInputForSampleB">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="buttonBar">
|
||||
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}">
|
||||
<input type="submit" name="_eventId_end-A-and-launch-B" value="End Sample A and Launch Sample B">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ul>
|
||||
Alternatively, you may spawn Sample B as a sub flow of Sample A. In this case a flow
|
||||
attribute mapper maps the input stored in the FlowScope of Sample A down to the spawning subflow
|
||||
Here again you have the option of using:
|
||||
<ul>
|
||||
<table>
|
||||
<tr>
|
||||
<td>an anchor:</td>
|
||||
<td>
|
||||
<a href="<c:url value="/flowController.htm?_flowExecutionKey=${flowExecutionKey}&_eventId=launch-B-as-subflow"/>">
|
||||
Launch Sample B as a Sub Flow
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">or a form:</td>
|
||||
<td>
|
||||
<table>
|
||||
<form action="flowController.htm" method="post">
|
||||
<tr>
|
||||
<td class="buttonBar">
|
||||
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}">
|
||||
<input type="submit" name="_eventId_launch-B-as-subflow" value="Launch Sample B as a Sub Flow">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ul>
|
||||
Yet another option is to launch Sample B as a top-level flow without involving Sample A as:
|
||||
<ul>
|
||||
<table>
|
||||
<tr>
|
||||
<td>an anchor:</td>
|
||||
<td>
|
||||
<a href="<c:url value="/flowController.htm?_flowId=sampleB&input=someInputForSampleB"/>">
|
||||
Launch Sample B
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">or a form:</td>
|
||||
<td>
|
||||
<table>
|
||||
<form action="flowController.htm" method="post">
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="input" value="someInputForSampleB">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="buttonBar">
|
||||
<input type="hidden" name="_flowId" value="sampleB">
|
||||
<input type="submit" value="Launch Sample B">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ul>
|
||||
<form action="<c:url value="/index.html"/>">
|
||||
<INPUT type="submit" value="Home">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<%@ include file="includeBottom.jsp" %>
|
||||
@@ -0,0 +1,45 @@
|
||||
<%@ include file="includeTop.jsp" %>
|
||||
|
||||
<div id="content">
|
||||
Sample B Flow
|
||||
<hr>
|
||||
Flow input was: ${input}<BR>
|
||||
<c:if test="${!flowExecutionContext.activeSession.root}">
|
||||
<br>
|
||||
Sample B is now running as a sub flow within Sample A. This means we can end Sample B and
|
||||
return to the parent flow. We can do this using either:
|
||||
<ul>
|
||||
<table>
|
||||
<tr>
|
||||
<td>an anchor:</td>
|
||||
<td>
|
||||
<a href="<c:url value="/flowController.htm?_flowExecutionKey=${flowExecutionKey}&_eventId=end"/>">
|
||||
End Sample B
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">or a form:</td>
|
||||
<td>
|
||||
<table>
|
||||
<form action="flowController.htm" method="post">
|
||||
<tr>
|
||||
<td class="buttonBar">
|
||||
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}">
|
||||
<input type="submit" name="_eventId_end" value="End Sample B">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</ul>
|
||||
</c:if>
|
||||
<hr>
|
||||
<form action="<c:url value="/index.html"/>">
|
||||
<input type="submit" value="Home">
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<%@ include file="includeBottom.jsp" %>
|
||||
@@ -0,0 +1,5 @@
|
||||
<div id="copyright">
|
||||
<p>© Copyright 2002-2006, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
<%@ page contentType="text/html" %>
|
||||
<%@ page session="false" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Launch a flow</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" href="style.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="logo">
|
||||
<img src="images/spring-logo.jpg" alt="Logo">
|
||||
</div>
|
||||
|
||||
<div id="navigation">
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow xmlns="http://www.springframework.org/schema/webflow"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/webflow
|
||||
http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
|
||||
|
||||
<input-mapper>
|
||||
<mapping source="input" target="flowScope.input" />
|
||||
</input-mapper>
|
||||
|
||||
<start-state idref="aPage" />
|
||||
|
||||
<view-state id="aPage" view="aPage">
|
||||
<transition on="launch-B-as-subflow" to="launchB" />
|
||||
<transition on="end-A-and-launch-B" to="endAndLaunchB" />
|
||||
</view-state>
|
||||
|
||||
<subflow-state id="launchB" flow="sampleB">
|
||||
<attribute-mapper>
|
||||
<input-mapper>
|
||||
<mapping source="requestParameters.input" target="input" />
|
||||
</input-mapper>
|
||||
</attribute-mapper>
|
||||
<transition on="end" to="aPage" />
|
||||
</subflow-state>
|
||||
|
||||
<end-state id="endAndLaunchB" view="flowRedirect:sampleB?input=${requestParameters.input}" />
|
||||
|
||||
</flow>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<flow xmlns="http://www.springframework.org/schema/webflow"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/webflow
|
||||
http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
|
||||
|
||||
<input-mapper>
|
||||
<mapping source="input" target="flowScope.input" />
|
||||
</input-mapper>
|
||||
|
||||
<start-state idref="bPage" />
|
||||
|
||||
<view-state id="bPage" view="bPage">
|
||||
<transition on="end" to="end" />
|
||||
</view-state>
|
||||
|
||||
<end-state id="end" />
|
||||
|
||||
</flow>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<servlet>
|
||||
<servlet-name>flowlauncher</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>flowlauncher</servlet-name>
|
||||
<url-pattern>*.htm</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
|
||||
</web-app>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,72 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<DIV align="left">Flow Launcher - A Spring Web Flow Sample</DIV>
|
||||
<HR>
|
||||
<DIV align="left">
|
||||
<P>
|
||||
This sample application demonstrates different ways of launching flows with
|
||||
input parameters.
|
||||
</P>
|
||||
<P>
|
||||
You can launch the Sample A flow as a top-level flow and pass it input using
|
||||
request parameters. This can be done using
|
||||
<table>
|
||||
<tr>
|
||||
<td>an anchor:</td>
|
||||
<td><A href="flowController.htm?_flowId=sampleA&input=someInputForSampleA">Start Sample A</A></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">or a form:</td>
|
||||
<td>
|
||||
<table>
|
||||
<form action="flowController.htm" method="post">
|
||||
<tr>
|
||||
<td><INPUT type="text" name="input" value="someInputForSampleA"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="buttonBar">
|
||||
<INPUT type="hidden" name="_flowId" value="sampleA">
|
||||
<INPUT type="submit" value="Start Sample A">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</P>
|
||||
<P>
|
||||
The same is true for Sample B:
|
||||
<table>
|
||||
<tr>
|
||||
<td>an anchor:</td>
|
||||
<td><A href="flowController.htm?_flowId=sampleB&input=someInputForSampleB">Start Sample B</A></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">or a form:</td>
|
||||
<td>
|
||||
<table>
|
||||
<form action="flowController.htm" method="post">
|
||||
<tr>
|
||||
<td><INPUT type="text" name="input" value="someInputForSampleB"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="buttonBar">
|
||||
<INPUT type="hidden" name="_flowId" value="sampleB">
|
||||
<INPUT type="submit" value="Start Sample B">
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</P>
|
||||
</DIV>
|
||||
<HR>
|
||||
<DIV align="right"></DIV>
|
||||
</BODY>
|
||||
</HTML>
|
||||
@@ -0,0 +1,58 @@
|
||||
body {
|
||||
width: 720px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div#logo {
|
||||
width: 720px;
|
||||
height: 73px;
|
||||
background: #86AEA5;
|
||||
}
|
||||
|
||||
div#navigation {
|
||||
width: 720px;
|
||||
height: 15px;
|
||||
background: #E2F3B8;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div#content {
|
||||
width: 720px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
div#insert {
|
||||
width: 120;
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.buttonBar {
|
||||
height: 1.5em;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
div#copyright {
|
||||
width: 720px;
|
||||
}
|
||||
|
||||
div#copyright p {
|
||||
text-align: center;
|
||||
font-family: Tahoma, sans-serif;
|
||||
font-size: 75%;
|
||||
color: div#336633;
|
||||
margin-left: 5px;
|
||||
font-weight: bold;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.readOnly {
|
||||
color: rgb(192, 192, 192);
|
||||
}
|
||||
|
||||
.error {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
Reference in New Issue
Block a user