Announcement Announcement Module
Collapse
No announcement yet.
FlowHandlerAdapter, FlowController and AbstractFlowHandler questions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • FlowHandlerAdapter, FlowController and AbstractFlowHandler questions

    Hi, I used spring web flow some time ago (more than a year) for a tiny project, and it was my first contact. Now that I'm starting another thing I've tried SWF 2, and there are some things I don't understand at all, and I don't really remember much about SWF1.

    As far as I know, when talking about web applications, we have the following scenario (I'm writing it because maybe my mistake is in this knowledge I'm assuming to be true):

    1. The dispatcher servlet receives a request. It asks the configured HandlerMapping(s) until anyone returns a HandlerExecutionChain (assuming there is such mapping for the request).

    2. The HandlerExecutionChain has interceptors, and an Object, the Handler.

    3. The DispatcherServlet uses a HandlerAdapter to execute te code from the handler and service the request.

    Now, for Controller implementations we have the SimpleControllerHandlerAdapter. There is also a FlowHandlerAdapter, meaning there would be a custom Handler for flows, and there is an abstract class that I could subclass, but... I could just use the FlowController, right? As the FlowController is a Controller, I have the SimpleControllerHandlerAdapter already, but I'm not quite sure if I need the FlowHandlerAdapter.

    I don't know when should I use each of them. When using SWF1 I just used the FlowController but I don't want to miss the point of using a custom FlowHandler.

    Thanks in advance.

  • #2
    Use FlowHandlerMapping in conjunction with FlowHandlerAdapter as described in ref manual and demoed in samples. For the simplest possible web flow sample, look at this new web flow project template here: https://src.springsource.org/svn/spr.../webflow/trunk.

    FlowController is old school and not nearly as elegant...

    Keith

    Comment


    • #3
      Ok, I'll try that then. Thanks for the clarification and for the template.

      Comment


      • #4
        I've seen the template for swf2 but it kinda confusing with the pom.xml contents..

        it uses the following:
        Code:
        		<!-- Container-provided dependencies-->
        		<dependency>
        			<groupId>javax.servlet</groupId>
        			<artifactId>servlet-api</artifactId>
        			<version>2.4</version>
        			<scope>provided</scope>
        		</dependency>
        		<dependency>
        			<groupId>javax.servlet.jsp</groupId>
        			<artifactId>jsp-api</artifactId>
        			<version>2.1</version>
        			<scope>provided</scope>
        		</dependency>
        And Apache Tomcat (http://tomcat.apache.org/whichversion.html) says:
        Code:
        Servlet/JSP Spec  	Apache Tomcat version  	Actual release revision
        2.5/2.1 			6.0.x 			6.0.24
        2.4/2.0 			5.5.x 			5.5.28
        May we ask the tomcat version of the template?

        Originally posted by Keith Donald View Post
        Use FlowHandlerMapping in conjunction with FlowHandlerAdapter as described in ref manual and demoed in samples. For the simplest possible web flow sample, look at this new web flow project template here: https://src.springsource.org/svn/spr.../webflow/trunk.

        FlowController is old school and not nearly as elegant...

        Keith

        Comment

        Working...
        X