org.springframework.webflow.mvc.servlet
Class FlowHandlerAdapter

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.webflow.mvc.servlet.FlowHandlerAdapter
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.HandlerAdapter

public class FlowHandlerAdapter
extends org.springframework.web.servlet.support.WebContentGenerator
implements org.springframework.web.servlet.HandlerAdapter, org.springframework.beans.factory.InitializingBean

A custom MVC HandlerAdapter that encapsulates the generic workflow associated with executing flows in a Servlet environment. Delegates to mapped flow handlers to manage the interaction with executions of specific flow definitions.

Author:
Keith Donald

Field Summary
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Constructor Summary
FlowHandlerAdapter()
          Creates a new flow handler adapter.
 
Method Summary
 void afterPropertiesSet()
           
 AjaxHandler getAjaxHandler()
          Returns the configured Ajax handler.
 FlowExecutor getFlowExecutor()
          Returns the central service for executing flows.
 FlowUrlHandler getFlowUrlHandler()
          Returns the flow url handler.
 long getLastModified(javax.servlet.http.HttpServletRequest request, Object handler)
           
 boolean getRedirectHttp10Compatible()
          Whether redirect sent by this handler adapter should be compatible with HTTP 1.0 clients.
 org.springframework.web.servlet.ModelAndView handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler)
           
 void setAjaxHandler(AjaxHandler ajaxHandler)
          Sets the configured Ajax handler.
 void setFlowExecutor(FlowExecutor flowExecutor)
          Sets the central service for executing flows.
 void setFlowUrlHandler(FlowUrlHandler flowUrlHandler)
          Sets the flow url handler
 void setRedirectHttp10Compatible(boolean redirectHttp10Compatible)
          Set whether redirects sent by this handler adapter should be compatible with HTTP 1.0 clients.
 boolean supports(Object handler)
           
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, setApplicationContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowHandlerAdapter

public FlowHandlerAdapter()
Creates a new flow handler adapter.

See Also:
setFlowExecutor(FlowExecutor), setFlowUrlHandler(FlowUrlHandler), setAjaxHandler(AjaxHandler), afterPropertiesSet()
Method Detail

getFlowExecutor

public FlowExecutor getFlowExecutor()
Returns the central service for executing flows. Required.


setFlowExecutor

public void setFlowExecutor(FlowExecutor flowExecutor)
Sets the central service for executing flows. Required.

Parameters:
flowExecutor -

getFlowUrlHandler

public FlowUrlHandler getFlowUrlHandler()
Returns the flow url handler.


setFlowUrlHandler

public void setFlowUrlHandler(FlowUrlHandler flowUrlHandler)
Sets the flow url handler

Parameters:
flowUrlHandler - the flow url handler

getAjaxHandler

public AjaxHandler getAjaxHandler()
Returns the configured Ajax handler.


setAjaxHandler

public void setAjaxHandler(AjaxHandler ajaxHandler)
Sets the configured Ajax handler.

Parameters:
ajaxHandler - the ajax handler

getRedirectHttp10Compatible

public boolean getRedirectHttp10Compatible()
Whether redirect sent by this handler adapter should be compatible with HTTP 1.0 clients.

Returns:
true if so, false otherwise

setRedirectHttp10Compatible

public void setRedirectHttp10Compatible(boolean redirectHttp10Compatible)
Set whether redirects sent by this handler adapter should be compatible with HTTP 1.0 clients.

By default, this will enforce a redirect HTTP status code of 302 by delegating to HttpServletResponse.sendRedirect. Setting this to false will send HTTP status code 303, which is the correct code for HTTP 1.1 clients, but not understood by HTTP 1.0 clients.

Many HTTP 1.1 clients treat 302 just like 303, not making any difference. However, some clients depend on 303 when redirecting after a POST request; turn this flag off in such a scenario.

See Also:
HttpServletResponse.sendRedirect(java.lang.String)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

supports

public boolean supports(Object handler)
Specified by:
supports in interface org.springframework.web.servlet.HandlerAdapter

handle

public org.springframework.web.servlet.ModelAndView handle(javax.servlet.http.HttpServletRequest request,
                                                           javax.servlet.http.HttpServletResponse response,
                                                           Object handler)
                                                    throws Exception
Specified by:
handle in interface org.springframework.web.servlet.HandlerAdapter
Throws:
Exception

getLastModified

public long getLastModified(javax.servlet.http.HttpServletRequest request,
                            Object handler)
Specified by:
getLastModified in interface org.springframework.web.servlet.HandlerAdapter