Skip to content

Commit

Permalink
Update reference
Browse files Browse the repository at this point in the history
Issue: SWF-1702
  • Loading branch information
rstoyanchev committed Feb 9, 2018
1 parent 9328890 commit 959fbad
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 285 deletions.
2 changes: 1 addition & 1 deletion src/dist/javascript-copyright.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2008 the original author or authors.
* Copyright 2004-2018 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.
Expand Down
4 changes: 2 additions & 2 deletions src/dist/notice.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Spring Web Flow ${version}
Copyright (c) 2002-${copyright} SpringSource, a division of VMware, Inc.
Copyright 2002-${copyright} the original author or authors.

This product is licensed to you under the Apache License, Version 2.0
(the "License"). You may not use this product except in compliance with
the License.

This product may include a number of subcomponents with separate
This product may include a number of sub-components with separate
copyright notices and license terms. Your use of the source code for
these subcomponents is subject to the terms and conditions of the
subcomponent's license, as noted in the license.txt file.
50 changes: 10 additions & 40 deletions src/dist/readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SPRING WEB FLOW ${version}
--------------------------
http://www.springframework.org/webflow
http://projects.spring.io/spring-webflow/

1. INTRODUCTION
---------------
Expand Down Expand Up @@ -34,18 +34,18 @@ Spring Web Flow is released under the terms of the Apache Software License (see
3. GETTING STARTED
------------------
Current samples:
https://github.com/SpringSource/spring-webflow-samples.
https://github.com/spring-projects/spring-webflow-samples.

4. OBTAINING RELEASE JARS WITH MAVEN OR IVY
-------------------------------------------
4. OBTAINING RELEASE JARS THROUGH MAVEN REPOSITORY
--------------------------------------------------
Release versions of Spring Web Flow artifacts are available via Maven Central.

For milestones and snapshots only (and for Ivy dependencies) you'll need to use the
SpringSource repository. Add the following repository to your Maven pom.xml:
For milestones and snapshots only you'll need to use the Spring repository.
Add the following repository to your Maven pom.xml:

<repository>
<id>springsource-repository</id>
<name>Spring project releases, milestones, and snapshots</name>
<id>spring</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
</repository>

Expand Down Expand Up @@ -73,36 +73,6 @@ If using JSF all you need to include is:
<version>${version}</version>
</dependency>

To access jars using Ivy, add the following repositories to your Ivy config:

<url name="com.springsource.repository.bundles.release">
<ivy pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/release/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>

<url name="com.springsource.repository.bundles.external">
<ivy pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/external/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>

Then declare the following dependencies in your ivy.xml:

<dependency org="org.springframework.webflow" name="org.springframework.binding" rev="${version}" conf="compile->runtime" />
<dependency org="org.springframework.webflow" name="org.springframework.js" rev="${version}" conf="compile->runtime" />
<dependency org="org.springframework.webflow" name="org.springframework.webflow" rev="${version}" conf="compile->runtime" />

If using JavaServerFaces:

<dependency org="org.springframework.webflow" name="org.springframework.faces" rev="${version}" conf="compile->runtime" />

For more information see the reference documentation and the SpringSource Repository FAQ:
https://github.com/spring-projects/spring-framework/wiki/Spring-repository-FAQ

5. ADDITIONAL RESOURCES
-----------------------
The Spring Web Flow homepage is located at:
http://projects.spring.io/spring-webflow/

The Spring Web Flow community forums are located at:
http://forum.spring.io/
For more details see the following Spring Framework wiki page:
https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-Artifacts

67 changes: 6 additions & 61 deletions src/reference/overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<sect1 xml:id="system-requirements">
<title>What Web Flow requires to run</title>
<para>
Java 1.6 or higher.
Java 1.8 or higher.
</para>
<para>
Spring 3.2 or higher.
Spring 5.0 or higher.
</para>
</sect1>
<sect1 xml:id="resources">
Expand All @@ -48,8 +48,7 @@
build system for your web development project.
</para>
<para>
To access Web Flow jars from Maven Central, declare the following dependency in your pom (includes
transitive dependencies "spring-binding"):
To access Web Flow jars from Maven Central, declare the following dependency in your pom:
</para>
<programlisting language="xml"><![CDATA[
<dependency>
Expand All @@ -72,54 +71,6 @@
]]>
</programlisting>
</sect1>
<sect1 xml:id="jars-ivy">
<title>How to access Web Flow artifacts with Ivy</title>
<para>
To access Spring Web Flow jars with Ivy, add the following repositories to your Ivy config:
</para>
<programlisting language="xml"><![CDATA[
<url name="com.springsource.repository.bundles.release">
<ivy pattern="http://repository.springsource.com/ivy/bundles/release/
[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/release/
[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>
<url name="com.springsource.repository.bundles.external">
<ivy pattern="http://repository.springsource.com/ivy/bundles/external/
[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
<artifact pattern="http://repository.springsource.com/ivy/bundles/external/
[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
</url>]]>
</programlisting>
<para>
To access Spring Web Flow jars as well as 3rd party dependencies with Ivy, add the following repository to your Ivy config:
</para>
<programlisting language="xml"><![CDATA[
<url name="springsource-repository">
<ivy pattern="http://repo.spring.io/libs-release/[organization]/[module]/[revision]/[type]s/ivy-[revision].xml" />
<artifact pattern="http://repo.spring.io/libs-release/[organization]/[module]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]" />
</url>]]>
</programlisting>
<para>
Then declare the following dependencies in your ivy.xml:
</para>
<programlisting language="xml"><![CDATA[
<dependency org="org.springframework.webflow" name="org.springframework.binding"
rev="x.y.z.RELEASE" conf="compile->runtime" />
<dependency org="org.springframework.webflow" name="org.springframework.js"
rev="x.y.z.RELEASE" conf="compile->runtime" />
<dependency org="org.springframework.webflow" name="org.springframework.webflow"
rev="x.y.z.RELEASE" conf="compile->runtime" />]]>
</programlisting>
<para>
If using JavaServer Faces, declare the following dependency in your pom (also adds the above dependencies):
</para>
<programlisting language="xml"><![CDATA[
<dependency org="org.springframework.webflow" name="org.springframework.faces"
rev="x.y.z.RELEASE" conf="compile->runtime" />]]>
</programlisting>
</sect1>
<sect1>
<title>How to access nightly builds and milestone releases</title>
<para>
Expand All @@ -134,29 +85,23 @@
</para>
<programlisting language="xml"><![CDATA[
<repository>
<id>springsource-repository</id>
<name>Spring project snapshots, milestones, and releases</name>
<id>spring</id>
<name>Spring Repository</name>
<url>http://repo.spring.io/snapshot</url>
</repository>]]>
</programlisting>
<para>
Then declare the following dependencies:
</para>
<programlisting language="xml"><![CDATA[
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-binding</artifactId>
<version>x.y.z.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>x.y.z.BUILD-SNAPSHOT</version>
</dependency>]]>
</programlisting>
<para>
And if using JavaServerFaces:
And if using JSF:
</para>
<programlisting language="xml"><![CDATA[
<dependency>
Expand Down
159 changes: 12 additions & 147 deletions src/reference/spring-faces.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,121 +11,12 @@ xsi:schemaLocation="

<sect1 xml:id="spring-faces-introduction">
<title>Introduction</title>

<para>Spring Web Flow provides a JSF integration that simplifies using JSF
with Spring. It lets you use the JSF UI Component Model with Spring MVC
and Spring Web Flow controllers. Along with the JSF integration Spring Web
Flow provides a Spring Security tag library for use in JSF environments
(see <xref linkend="spring-faces-security-taglib" /> for more details).
<para>
Spring Web Flow provides a JSF integration that lets you use the JSF UI
Component Model with Spring Web Flow controllers. Web Flow also provides
a Spring Security tag library for use in JSF environments,
see <xref linkend="spring-faces-security-taglib" /> for more details.
</para>

<para>Starting with Spring Web Flow version 2.4, JSF integration requires
JSF v2.0 or above. Both Sun Mojarra and Apache MyFaces runtime environments
are supported.</para>

</sect1>

<sect1 xml:id="spring-faces-integration">
<title>JSF Integration For Spring Developers</title>

<para>Spring Web Flow complements the strengths of JSF, its component
model, and provides more sophisticated state management and navigation. In
addition you have the ability to use Spring MVC @Controller or flow
definitions as controllers in the web layer.</para>

<para>JSF applications using Spring Web Flow applications gain benefits in
the following areas: <orderedlist>
<listitem>
<para>Managed bean facility</para>
</listitem>

<listitem>
<para>Scope management</para>
</listitem>

<listitem>
<para>Event handling</para>
</listitem>

<listitem>
<para>Navigation</para>
</listitem>

<listitem>
<para>Modularization and packaging of views</para>
</listitem>

<listitem>
<para>Cleaner URLs</para>
</listitem>

<listitem>
<para>Model-level validation</para>
</listitem>
</orderedlist> Using these features significantly reduce the amount of
configuration required in faces-config.xml. They provide a cleaner
separation between the view and controller layers along with better
modularization of application functionals. These features are detailed in
the sections to follow. The majority of these features build on the flow
definition language of Spring Web Flow. Therefore it is assumed that you
have an understanding of the foundations presented in <xref
linkend="defining-flows" />.</para>
</sect1>

<sect1 xml:id="spring-faces-upgrade-from-swf23">
<title>Upgrading from Spring Web Flow 2.3</title>

<para>If you are upgrading from Spring Web Flow 2.3 or earlier you may need to
update several aspects of your project. JSF 2.0 is now a minimum requirement
and as result some components from previous releases are no longer included.</para>

<sect2 xml:id="spring-faces-upgrade-from-swf23-components">
<title>Spring Faces Components</title>
<para>Previous releases of Spring Web Flow shipped with a component library
which provided Ajax and client-side validation capabilities for JSF 1.2
environments. Applications using these components will need to switch to a
3rd party JSF component library such as PrimeFaces or RichFaces.
Components that have been removed include <code>&lt;sf:clientTextValidator&gt;</code>,
<code>&lt;sf:clientNumberValidator&gt;</code>, <code>&lt;sf:clientDateValidator&gt;</code>,
<code>&lt;sf:validateAllOnClick&gt;</code>, <code>&lt;sf:resource&gt;</code> and
<code>&lt;sf:resourceGroup&gt;</code>.
The <code>swf-booking-faces</code> sample in the Spring Web Flow distribution
shows an example built with PrimeFaces components.</para>
</sect2>

<sect2 xml:id="spring-faces-upgrade-from-swf23-faces-config">
<title>Configuring faces-config.xml</title>
<para>If your application defines a <code>faces-config.xml</code> file you should
ensure that the correct schema version is specified. In addition you should remove
any <code>FaceletViewHandler</code> references as Facelets are now the default rendering
technology for JSF 2.0</para>

<programlisting language="xml">
&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;faces-config xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0"&gt;

&lt;/faces-config&gt;
</programlisting>
</sect2>

<sect2 xml:id="spring-faces-upgrade-from-swf23-thirdpartylibraries">
<title>Third-party Libraries</title>
<para>Previous releases of Spring Web Flow would often require additional configuration in order
for 3rd party component libraries to work correctly. JSF 2.0 introduced standard resource
loading mechanisms that removes the need for such custom configuration. As long as you
have a <code>&lt;faces:resources&gt;</code> element in your Spring configuration, libraries
such as RichFaces or Apache Trinidad you should work.</para>
</sect2>

<sect2 xml:id="spring-faces-upgrade-from-swf23-security-taglib">
<title>Spring Security Facelets Tag Library</title>
<para>If you have a previously configured <code>/WEB-INF/springsecurity.taglib.xml</code> file
you may need to update the contents. See <xref linkend="spring-faces-security-taglib"/> for
details.</para>
</sect2>
</sect1>

<sect1 xml:id="spring-faces-config-web.xml">
Expand Down Expand Up @@ -737,7 +628,7 @@ mvn package
with these components JSF must take complete control of parsing multi-part requests and Spring MVC's
<code>MultipartResolver</code> cannot be used.</para>

<para>Spring Web Flow has been tested with file upload components from PrimeFaces and RichFaces. Check the
<para>Spring Web Flow has been tested with file upload components from PrimeFaces. Check the
documentation of your JSF component library for other providers to see how to configure file upload.</para>

<sect2>
Expand All @@ -753,42 +644,16 @@ mvn package
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
</filter-mapping>]]>
</filter-mapping>
<context-param>
<param-name>primefaces.UPLOADER</param-name>
<param-value>commons</param-value>
</context-param>]]>
</programlisting>
<para>For more details refer to the
<link xl:href="http://primefaces.org/documentation.html">PrimeFaces documentation</link>.</para>
</sect2>

<sect2>
<title>File Uploads with RichFaces</title>
<para>RichFaces provides a <code>&lt;rich:fileUpload&gt;</code> component for uploading files. No
special configuration is required to use the component, however, you will need to perform
some additional steps in your <code>fileUploadListener</code>.</para>
<para>Here is some typical XHTML markup. In this example the <code>fileUploadBean</code> refers
to Spring singleton bean.</para>
<programlisting language="xml"><![CDATA[<rich:fileUpload id="upload"
fileUploadListener="#{fileUploadBean.listener}"
acceptedTypes="jpg, gif, png, bmp">
</rich:fileUpload>]]></programlisting>
<para>Within your <code>fileUploadBean</code> you need to tell Web Flow that the response has been
handled and that it should not attempt any redirects. The <interfacename>org.springframework.webflow.context.ExternalContext</interfacename>
interface provides a <code>recordResponseComplete()</code> for just such purposes.</para>
<para>In addition, it is imperative that some partial response data is returned to the client. If your
<code>&lt;rich:fileUpload&gt;</code> component does not specify a <code>render</code> attribute you
may need to call <code>processPartial(PhaseId.RENDER_RESPONSE)</code> on the JSF
<code>PartialViewContext</code>.</para>
<programlisting language="java">public class FileUploadBean {

public void listener(FileUploadEvent event) throws Exception{
FacesContext.getCurrentInstance().getPartialViewContext().processPartial(PhaseId.RENDER_RESPONSE);
ExternalContextHolder.getExternalContext().recordResponseComplete();
UploadedFile file = event.getUploadedFile();
// Do something with the file
}
}</programlisting>
<para>For more details refer to the
<link xl:href="http://www.jboss.org/richfaces/docs">RichFaces documentation</link>.</para>
</sect2>
</sect1>

<sect1 xml:id="spring-faces-security-taglib">
Expand Down
Loading

0 comments on commit 959fbad

Please sign in to comment.