This commit is contained in:
Scott Andrews
2008-04-11 20:30:17 +00:00
parent 477c9e335f
commit dd86949a6e

View File

@@ -183,39 +183,79 @@ java org.springframework.webflow.engine.model.builder.xml.WebFlowUpgrader flowTo
]]></programlisting>
</sect2>
<sect2 id="upgrade-guide-webflow-config-view-resolver">
<title>Custom View Resolvers</title>
<title>View Resolution</title>
<para>
Web Flow 2.0 by default will both select and render views.
View were previously selected by Web Flow 1.0 and then rendered by a view resolver.
</para>
<para>
In order for 1.0 based flows to work in Web Flow 2.0 the default view resolver must be overridden.
A common use case is to use <ulink url="http://tiles.apache.org/">Apache Tiles</ulink> for view resolution.
The following configuration will replace the default view resolver with a Tiles view resolver.
The <code>tilesViewResolver</code> in this example can be replaced with any other view resolver.
</para>
<programlisting language="xml"><![CDATA[
<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
...
</webflow:flow-registry>
<webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator"/>
<bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.MvcViewFactoryCreator">
<property name="viewResolvers" ref="tilesViewResolver"/>
</bean>
<bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.tiles.TilesJstlView"/>
</bean>
<bean class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
<property name="definitions" value="/WEB-INF/tiles-def.xml" />
</bean>
]]></programlisting>
</sect2>
</sect1>
<sect1 id="upgrade-guide-webflow-concepts">
<title>Web Flow Concepts</title>
<title>New Web Flow Concepts</title>
<sect2 id="upgrade-guide-webflow-concepts-binding">
<title>Automatic Model Binding</title>
<para>
Web Flow 1.0 required Spring MVC based flows to manually calls to <code>FormAction</code> methods, mainly: <code>setupForm</code>, <code>bind</code> and <code>bindAndValidate</code>.
Web Flow 2.0 now supports automatic setup, binding and validation via the <code>model</code> attribute for <code>view-state</code>s.
Please see the <link linkend="view-model">Binding to a Model</link> section for details.
</para>
</sect2>
<sect2 id="upgrade-guide-webflow-concepts-el-v-ognl">
<title>OGNL vs EL</title>
<para>
Web Flow 1.0 used OGNL exclusively for expressions within the flow definitions.
Web Flow 2.0 adds support for Unified EL.
United EL is used when it is available, OGNL will continue to be used when a Unified EL implementation is not available.
Please see the <link linkend="el">Expression Language</link> chapter for details.
</para>
</sect2>
<sect2 id="upgrade-guide-webflow-concepts-flash-scope">
<title>Flash Scope</title>
</sect2>
<sect2 id="upgrade-guide-webflow-concepts-redirects">
<title>External Redirects</title>
</sect2>
<sect2 id="upgrade-guide-webflow-concepts-views">
<title>Views</title>
<para>
Views are handled differently in Web Flow 2.0.
Previously, Web Flow returned a reference to the view to render.
Then a view resolver would render the view.
Web Flow 2.0 will both select and render views.
Flash scope in Web Flow 1.0 persisted across the current request and into the next request.
In Web Flow 2.0 flash scope is cleared after every view render.
This allows objects to persist across the POST-REDIRECT-GET pattern, while being independent of the next request.
</para>
</sect2>
<sect2 id="upgrade-guide-webflow-concepts-jsf">
<title>JavaServer Faces</title>
<title>Spring Faces</title>
<para>
Web Flow 2.0 provides significant support for JavaServer Faces.
Please see the <link linkend="spring-faces">JSF Integration</link> chapter for details.
</para>
</sect2>
<sect2 id="upgrade-guide-webflow-concepts-binding">
<title>Automatic Model Binding</title>
<sect2 id="upgrade-guide-webflow-concepts-redirects">
<title>External Redirects</title>
<para>
External redirects in Web Flow 1.0 were always considered context relative.
In Web Flow 2.0, if the redirect URL begins with a slash, it is considered absolute to the server root instead of the application context.
URLs without a leading slash are still context relative.
</para>
</sect2>
</sect1>
</chapter>