From a1c6c27e6eb20cb02d6107cb183d42319d2270fa Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Sun, 22 Mar 2009 02:09:19 +0000 Subject: [PATCH] polish --- .../WEB-INF/tutorial/webflowExercise.jsp | 34 ++++++++++--------- .../tutorial/webflowProjectOverview.jsp | 2 +- .../webapp/WEB-INF/tutorial/webflowSetup.jsp | 8 +++-- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowExercise.jsp b/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowExercise.jsp index 7813fe40..f26cb36f 100644 --- a/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowExercise.jsp +++ b/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowExercise.jsp @@ -22,7 +22,7 @@

XML is a good format for expressing structure. Since a flow definition primarily captures the navigation structure between your pages, XML is a good fit. - XML is not an appropriate for general programming. + XML is not appropriate for general programming. This is why your flows should invoke actions written in Java or Groovy to carry out application behaviors.

@@ -52,7 +52,7 @@

Create your first helloworld flow

  1. - Once the application is running, create a new directory for your flow inside /WEB-INF; name the directory helloworld. + Once the application is running, create a new directory for your flow inside /src/main/webapp/WEB-INF; name the directory helloworld. Next, right-click on the directory and access New -> Spring Web Flow Definition. Enter the filename helloworld-flow.xml and finish. The flow definition will be generated for you with an initial view-state named start. @@ -71,7 +71,7 @@
  2. - From the Servers view, restart your server, then startup your flow by accessing http://localhost:8080/app/helloworld. + From the Servers view, restart your server, then startup your flow by accessing http://localhost:8080/getting-started-with-spring-webflow/app/helloworld. You should see your Hello world! message display. Note you only have to restart your server when you add new flows to the system. When you change flows, changes will be refreshed automatically.
  3. @@ -114,8 +114,8 @@

    1. - Try implementing a dynamic navigation rule by adding a bound checkbox to your start.jsp. - Do this by first replacing the contents of your start.jsp with the following snippet: + Try implementing a dynamic navigation rule by first adding a bound checkbox to your start.jsp. + Do this by replacing the contents of your start.jsp with the following snippet:
       	<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
       	<html>
      @@ -139,7 +139,7 @@
       	
       	import java.io.Serializable;
       	
      -	public class HelloworldForm implements Serializable {
      +	public class HelloWorldForm implements Serializable {
       	    private boolean selected = true;
       	    
       	    public boolean isSelected() {
      @@ -153,7 +153,7 @@
       		
    2. - In your helloworld-flow, declare the HelloWorldForm as a flow variable: + At the top of your helloworld-flow, declare the HelloWorldForm as a flow variable:
       	<var name="helloWorldForm" class="org.springframework.webflow.samples.helloworld.HelloWorldForm" />
       		
      @@ -167,23 +167,25 @@

    3. - Add a navigation decision that says if selected goto page2 else goto a new page3: -
      -	<view-state id="start">
      -		<transition on="submit" to="isSelected" />
      -	</view-state>
      -	
      +		Now insert a decision state that says if the checkbox is selected goto page2, else goto a new page3:
      +		
      	
       	<decision-state id="isSelected">
       		<if test="helloWorldForm.selected" then="page2" else="page3" />
       	</decision-state>
       
      -	...
      +	<view-state id="page2">
      +	</view-state>	
           
       	<view-state id="page3">
       	</view-state>	
      -
       		
      - Click the button with the checkbox selected and you should be taken to page2. + Be sure to update your start view-state to transition to the isSelected decision state instead of page2 directly: +
      +	<view-state id="start">
      +		<transition on="submit" to="isSelected" />
      +	</view-state>		
      +		
      + Click the Submit button with the checkbox selected and you should be taken to page2. Click the button with the checkbox de-selected and you should be taken to page3 (you'll need to create a JSP or you'll get a 404).
    diff --git a/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowProjectOverview.jsp b/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowProjectOverview.jsp index f4d450f6..8faf7dac 100644 --- a/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowProjectOverview.jsp +++ b/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowProjectOverview.jsp @@ -29,7 +29,7 @@ The framework also cares for managing conversational state and preventing duplic

    Spring Web Flow builds on the Spring Framework project, which includes the Spring MVC web framework. Concretely, Spring Web Flow plugs into Spring MVC as a Controller technology. -A typical Spring-powered web application is implemented using a mix of annotated Spring MVC @Controllers and web flows. +A typical Spring-powered web application is implemented using a mix of annotated Spring MVC Controllers and web flows. In general, use @Controllers for implementing simple, single-request user interactions, and web flows for stateful, multi-step user interactions.

    diff --git a/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowSetup.jsp b/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowSetup.jsp index 0320ba9a..3395b052 100644 --- a/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowSetup.jsp +++ b/spring-webflow-samples/getting-started-with-spring-webflow/src/main/webapp/WEB-INF/tutorial/webflowSetup.jsp @@ -8,6 +8,10 @@

    Setting up Web Flow in a Spring Web Application

    +

    +This step covers the one-time configuration step of setting Web Flow up in a Spring web application. +If you prefer to go right to implementing your first flow, you can skip this step. +

    What does the configuration of a typical Spring web application look like?

    @@ -127,7 +131,7 @@ This is done by consulting an ordered chain of HandlerMapping objects configured in your mvc-config.xml. Generally, the first HandlerMapping consulted is the FlowHandlerMapping, which determines if the requested resource should be handled by a web flow. If no flow handler is found, the next HandlerMapping in the chain is queried. - This is generally the DefaultAnnotationHandlerMapping, which consults explicit @RequestMapping rules defined inside annotated Spring MVC @Controllers. + This is generally the DefaultAnnotationHandlerMapping, which consults explicit @RequestMapping rules defined inside annotated Spring MVC Controllers.

    Setting up the HandlerMapping chain is a one-time configuration step, and makes it easy to plug in different types of handlers and mapping strategies. @@ -135,7 +139,7 @@

     	<!-- Maps requests to flows in the flowRegistry; for example, a request for resource /hotels/booking maps to a flow with id "hotels/booking"
    -		 If no flow is found with that id, Spring MVC proceeds to the next HandlerMapping (order=1 below). -->
    +	     If no flow is found with that id, Spring MVC proceeds to the next HandlerMapping (order=1 below). -->
     	<bean id="flowMappings" class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
     		<property name="order" value="0" />
     		<property name="flowRegistry" ref="flowRegistry" />