Moved Spring Web Flow to a top level project
This commit is contained in:
9
spring-webflow-samples/itemlist/.classpath
Normal file
9
spring-webflow-samples/itemlist/.classpath
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src/main/java"/>
|
||||
<classpathentry output="target/test-classes" kind="src" path="src/test/java"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v5.5"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
8
spring-webflow-samples/itemlist/.cvsignore
Normal file
8
spring-webflow-samples/itemlist/.cvsignore
Normal file
@@ -0,0 +1,8 @@
|
||||
target
|
||||
lib
|
||||
bak
|
||||
build.properties
|
||||
*.log
|
||||
*.jpx.local*
|
||||
*.iws
|
||||
*.tws
|
||||
36
spring-webflow-samples/itemlist/.project
Normal file
36
spring-webflow-samples/itemlist/.project
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>swf-itemlist</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.springframework.ide.eclipse.core.springbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.springframework.ide.eclipse.core.springnature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,8 @@
|
||||
#Mon Nov 13 17:29:33 PST 2006
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
|
||||
org.eclipse.jdt.core.compiler.compliance=1.5
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.5
|
||||
@@ -0,0 +1,3 @@
|
||||
#Mon Nov 13 17:29:33 PST 2006
|
||||
eclipse.preferences.version=1
|
||||
internal.default.compliance=default
|
||||
@@ -0,0 +1,4 @@
|
||||
#Mon Nov 13 17:23:47 PST 2006
|
||||
classpath.helper/org.eclipse.jdt.launching.JRE_CONTAINER/owners=jst.java\:5.0
|
||||
classpath.helper/org.eclipse.jst.server.core.container\:\:org.eclipse.jst.server.tomcat.runtimeTarget\:\:Apache\ Tomcat\ v5.5/owners=jst.web\:2.4
|
||||
eclipse.preferences.version=1
|
||||
51
spring-webflow-samples/itemlist/.settings/org.eclipse.wst.common.component
Executable file
51
spring-webflow-samples/itemlist/.settings/org.eclipse.wst.common.component
Executable file
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="swf-itemlist">
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/standard.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/spring-webmvc.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/spring-webflow.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/spring-web.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/spring-core.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/spring-context.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/spring-binding.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/spring-beans.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/ognl.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/log4j.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/junit.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/jstl.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/commons-logging.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/swf-itemlist/lib/global/commons-codec.jar">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<property name="java-output-path" value="target/classes"/>
|
||||
<property name="context-root" value="swf-itemlist"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<fixed facet="jst.web"/>
|
||||
<fixed facet="jst.java"/>
|
||||
<installed facet="jst.web" version="2.4"/>
|
||||
<installed facet="jst.java" version="5.0"/>
|
||||
</faceted-project>
|
||||
@@ -0,0 +1,6 @@
|
||||
#Mon Nov 13 17:29:33 PST 2006
|
||||
DELEGATES_PREFERENCE=delegateValidatorListorg.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator\=org.eclipse.wst.wsdl.validation.internal.eclipse.Validator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator\=org.eclipse.wst.xsd.core.internal.validation.eclipse.Validator;
|
||||
USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.jsp.core.internal.validation.JSPELValidator;org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator;org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;
|
||||
USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.html.internal.validation.HTMLValidator;org.eclipse.wst.xml.core.internal.validation.eclipse.Validator;org.eclipse.wst.dtd.core.internal.validation.eclipse.Validator;org.eclipse.wst.wsdl.validation.internal.eclipse.WSDLDelegatingValidator;org.eclipse.jst.j2ee.internal.web.validation.UIWarValidator;org.eclipse.jst.jsp.core.internal.validation.JSPELValidator;org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidator;org.eclipse.jst.jsp.core.internal.validation.JSPDirectiveValidator;org.eclipse.wst.common.componentcore.internal.ModuleCoreValidator;org.eclipse.wst.wsi.ui.internal.WSIMessageValidator;org.eclipse.wst.xsd.core.internal.validation.eclipse.XSDDelegatingValidator;
|
||||
USER_PREFERENCE=overrideGlobalPreferencesfalse
|
||||
eclipse.preferences.version=1
|
||||
8
spring-webflow-samples/itemlist/.springBeans
Normal file
8
spring-webflow-samples/itemlist/.springBeans
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beansProjectDescription>
|
||||
<configs>
|
||||
<config>src/main/webapp/WEB-INF/itemlist-servlet.xml</config>
|
||||
</configs>
|
||||
<configSets>
|
||||
</configSets>
|
||||
</beansProjectDescription>
|
||||
16
spring-webflow-samples/itemlist/build.xml
Normal file
16
spring-webflow-samples/itemlist/build.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<project name="swf-itemlist" default="dist">
|
||||
|
||||
<property file="build.properties"/>
|
||||
<property file="project.properties"/>
|
||||
<property file="${common.build.dir}/build.properties"/>
|
||||
<property file="${common.build.dir}/project.properties"/>
|
||||
<property file="${user.home}/build.properties"/>
|
||||
|
||||
<property name="build.web" value="true"/>
|
||||
|
||||
<import file="${common.build.dir}/common-targets.xml"/>
|
||||
<import file="${common.build.dir}/tomcat-targets.xml"/>
|
||||
|
||||
</project>
|
||||
20
spring-webflow-samples/itemlist/ivy.xml
Normal file
20
spring-webflow-samples/itemlist/ivy.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<ivy-module version="1.1">
|
||||
|
||||
<info organisation="org.springframework" module="swf-itemlist"/>
|
||||
|
||||
<configurations>
|
||||
<conf name="default" extends="global"/>
|
||||
<conf name="global" visibility="private"/>
|
||||
<conf name="buildtime" visibility="private"/>
|
||||
<conf name="test" visibility="private"/>
|
||||
</configurations>
|
||||
|
||||
<dependencies defaultconf="global->default">
|
||||
<!-- global dependencies -->
|
||||
<dependency org="log4j" name="log4j" rev="1.2.13"/>
|
||||
<dependency org="taglibs" name="standard" rev="1.1.2"/>
|
||||
<dependency org="jstl" name="jstl" rev="1.1.2"/>
|
||||
<dependency org="org.springframework" name="spring-webflow" rev="latest.integration"/>
|
||||
</dependencies>
|
||||
|
||||
</ivy-module>
|
||||
10
spring-webflow-samples/itemlist/project.properties
Normal file
10
spring-webflow-samples/itemlist/project.properties
Normal file
@@ -0,0 +1,10 @@
|
||||
# properties defined in this file are overridable by a local build.properties in this project dir
|
||||
|
||||
# The location of the common build system
|
||||
common.build.dir=${basedir}/../../common-build
|
||||
|
||||
javac.source=1.3
|
||||
javac.target=1.3
|
||||
|
||||
# Do not publish built artifacts to the integration repository
|
||||
do.publish=false
|
||||
33
spring-webflow-samples/itemlist/src/etc/filter.properties
Normal file
33
spring-webflow-samples/itemlist/src/etc/filter.properties
Normal file
@@ -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,42 @@
|
||||
/*
|
||||
* Copyright 2002-2006 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.webflow.samples.itemlist;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.webflow.action.AbstractAction;
|
||||
import org.springframework.webflow.execution.Event;
|
||||
import org.springframework.webflow.execution.RequestContext;
|
||||
|
||||
public class AddItemAction extends AbstractAction {
|
||||
|
||||
protected Event doExecute(RequestContext context) throws Exception {
|
||||
Collection list = context.getFlowScope().getRequiredCollection("list");
|
||||
String data = context.getRequestParameters().get("data");
|
||||
if (data != null && data.length() > 0) {
|
||||
list.add(data);
|
||||
}
|
||||
|
||||
try {
|
||||
// add a bit of artificial think time
|
||||
Thread.sleep(2000);
|
||||
}
|
||||
catch (InterruptedException e) {
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2002-2006 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.webflow.samples.itemlist;
|
||||
|
||||
import org.springframework.binding.mapping.DefaultAttributeMapper;
|
||||
import org.springframework.binding.mapping.MappingBuilder;
|
||||
import org.springframework.webflow.core.DefaultExpressionParserFactory;
|
||||
|
||||
public class DataMapper extends DefaultAttributeMapper {
|
||||
|
||||
public DataMapper() {
|
||||
MappingBuilder mapping = new MappingBuilder(DefaultExpressionParserFactory.getExpressionParser());
|
||||
addMapping(mapping.source("requestParameters.data").target("flowScope.item").value());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2002-2006 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.webflow.samples.itemlist;
|
||||
|
||||
import org.springframework.webflow.action.AbstractAction;
|
||||
import org.springframework.webflow.execution.Event;
|
||||
import org.springframework.webflow.execution.RequestContext;
|
||||
|
||||
public class NewItemAction extends AbstractAction {
|
||||
|
||||
protected Event doExecute(RequestContext context) throws Exception {
|
||||
return success();
|
||||
}
|
||||
}
|
||||
@@ -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,45 @@
|
||||
<?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">
|
||||
|
||||
<var name="list" class="java.util.ArrayList" />
|
||||
|
||||
<start-state idref="displayItemlist" />
|
||||
|
||||
<view-state id="displayItemlist" view="itemlist">
|
||||
<transition on="add" to="addItem" />
|
||||
</view-state>
|
||||
|
||||
<subflow-state id="addItem" flow="item">
|
||||
<attribute-mapper>
|
||||
<output-mapper>
|
||||
<mapping source="item" target-collection="flowScope.list" />
|
||||
</output-mapper>
|
||||
</attribute-mapper>
|
||||
<transition on="finish" to="displayItemlist" />
|
||||
</subflow-state>
|
||||
|
||||
<inline-flow id="item">
|
||||
<flow>
|
||||
<start-state idref="displayItem"/>
|
||||
|
||||
<view-state id="displayItem" view="item">
|
||||
<transition on="submit" to="mapItem" />
|
||||
</view-state>
|
||||
|
||||
<action-state id="mapItem">
|
||||
<action bean="mapItemAction" />
|
||||
<transition on="success" to="finish" />
|
||||
</action-state>
|
||||
|
||||
<end-state id="finish">
|
||||
<output-mapper>
|
||||
<mapping source="flowScope.item" target="item" />
|
||||
</output-mapper>
|
||||
</end-state>
|
||||
</flow>
|
||||
</inline-flow>
|
||||
|
||||
</flow>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
|
||||
"http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
||||
<property name="alwaysUseFullPath" value="true" />
|
||||
<property name="mappings">
|
||||
<value>/app/**/**=flowController</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
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. /app/itemlist
|
||||
-->
|
||||
<bean id="flowController" class="org.springframework.webflow.executor.mvc.FlowController">
|
||||
<property name="flowExecutor" ref="flowExecutor" />
|
||||
<property name="argumentHandler">
|
||||
<bean class="org.springframework.webflow.executor.support.RequestPathFlowExecutorArgumentHandler" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Launches new flow executions and resumes existing executions: Spring 1.2 config version -->
|
||||
<bean id="flowExecutor" class="org.springframework.webflow.config.FlowExecutorFactoryBean">
|
||||
<property name="definitionLocator" ref="flowRegistry"/>
|
||||
</bean>
|
||||
|
||||
<!-- Creates the registry of flow definitions for this application: Spring 1.2 config version -->
|
||||
<bean id="flowRegistry" class="org.springframework.webflow.engine.builder.xml.XmlFlowRegistryFactoryBean">
|
||||
<property name="flowLocations">
|
||||
<list>
|
||||
<value>/WEB-INF/itemlist.xml</value>
|
||||
<value>/WEB-INF/itemlist-alternate</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<bean id="createItemAction" class="org.springframework.webflow.samples.itemlist.NewItemAction" />
|
||||
|
||||
<bean id="addItemAction" class="org.springframework.webflow.samples.itemlist.AddItemAction" />
|
||||
|
||||
<bean id="mapItemAction" class="org.springframework.webflow.action.AttributeMapperAction">
|
||||
<constructor-arg>
|
||||
<bean class="org.springframework.webflow.samples.itemlist.DataMapper" />
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
@@ -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">
|
||||
|
||||
<var name="list" class="java.util.ArrayList" />
|
||||
|
||||
<start-state idref="displayItemlist" />
|
||||
|
||||
<view-state id="displayItemlist" view="itemlist">
|
||||
<transition on="add" to="createItem" />
|
||||
</view-state>
|
||||
|
||||
<action-state id="createItem">
|
||||
<action bean="createItemAction" />
|
||||
<transition on="success" to="displayItem" />
|
||||
</action-state>
|
||||
|
||||
<view-state id="displayItem" view="item">
|
||||
<transition on="submit" to="addItem" />
|
||||
</view-state>
|
||||
|
||||
<action-state id="addItem">
|
||||
<action bean="addItemAction" />
|
||||
<transition on="*" to="displayItemlist" />
|
||||
</action-state>
|
||||
|
||||
</flow>
|
||||
@@ -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>Create an item list</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" href="<c:url value='/style.css'/>" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="logo">
|
||||
<img src="<c:url value='/images/spring-logo.jpg'/>" alt="Spring Logo">
|
||||
</div>
|
||||
|
||||
<div id="navigation">
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
<%@ include file="includeTop.jsp" %>
|
||||
|
||||
<div id="content">
|
||||
<div id="insert">
|
||||
<img src="<c:url value='/images/webflow-logo.jpg'/>" alt="Web Flow Logo">
|
||||
</div>
|
||||
<h2>Add a new item</h2>
|
||||
<hr>
|
||||
<!-- Tell webflow what executing flow we are participating in -->
|
||||
<form action="${flowExecutionKey}" method="post"/>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Item:
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="data">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="buttonBar">
|
||||
<!-- Tell webflow what event happened -->
|
||||
<input type="submit" name="_eventId_submit" value="Submit">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<%@ include file="includeBottom.jsp" %>
|
||||
@@ -0,0 +1,31 @@
|
||||
<%@ include file="includeTop.jsp" %>
|
||||
|
||||
<div id="content">
|
||||
<div id="insert">
|
||||
<img src="<c:url value='/images/webflow-logo.jpg'/>" alt="Web Flow Logo">
|
||||
</div>
|
||||
<h2>Your item list</h2>
|
||||
<hr>
|
||||
<!-- Tell webflow what executing flow we're participating in -->
|
||||
<form action="${flowExecutionKey}" method="post"/>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table border="1" width="300px">
|
||||
<c:forEach var="item" items="${list}">
|
||||
<tr><td>${item}</td></tr>
|
||||
</c:forEach>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="buttonBar">
|
||||
<!-- Tell webflow what event happened -->
|
||||
<input type="submit" name="_eventId_add" value="Add New Item">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<%@ include file="includeBottom.jsp" %>
|
||||
@@ -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>itemlist</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>itemlist</servlet-name>
|
||||
<url-pattern>/app/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.jsp</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 |
46
spring-webflow-samples/itemlist/src/main/webapp/index.jsp
Normal file
46
spring-webflow-samples/itemlist/src/main/webapp/index.jsp
Normal file
@@ -0,0 +1,46 @@
|
||||
<%@ page session="true" %> <%-- make sure we have a session --%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<HTML>
|
||||
<HEAD>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
|
||||
<DIV align="left">Item List - A Spring Web Flow Sample</DIV>
|
||||
|
||||
<HR>
|
||||
|
||||
<DIV align="left">
|
||||
<P>
|
||||
<A href="app/itemlist">Item List</A>
|
||||
</P>
|
||||
|
||||
<P>
|
||||
This Spring web flow sample application illustrates several features:
|
||||
<UL>
|
||||
<LI>
|
||||
Launching flow's using bookmark-friendly, REST-style URLS
|
||||
</LI>
|
||||
<LI>
|
||||
Use of an inline-flow, including the ability to map subflow output attributes
|
||||
directly into collection attributes in parent flow scope.
|
||||
</LI>
|
||||
<LI>
|
||||
Event pattern matching, for matching eventId expressions to transitions.
|
||||
</LI>
|
||||
<LI>
|
||||
"Always redirect on pause" - to achieve the POST+REDIRECT+GET pattern with no special coding.
|
||||
</LI>
|
||||
<LI>
|
||||
Spring 1.2 compatible configuration, as an alternative to the Spring 2.0 support.
|
||||
</LI>
|
||||
</UL>
|
||||
</P>
|
||||
</DIV>
|
||||
|
||||
<HR>
|
||||
|
||||
<DIV align="right"></DIV>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
58
spring-webflow-samples/itemlist/src/main/webapp/style.css
Normal file
58
spring-webflow-samples/itemlist/src/main/webapp/style.css
Normal file
@@ -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