Class FlowController
java.lang.Object
org.springframework.webflow.mvc.servlet.FlowController
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationContextAware
,org.springframework.web.servlet.mvc.Controller
public class FlowController
extends Object
implements org.springframework.web.servlet.mvc.Controller, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
The adapter between the Spring MVC Controller layer and the Spring Web Flow engine. This controller allows Spring Web
Flow to run embedded as a Controller within a DispatcherServlet, the key piece of the Spring Web MVC platform. It is
expected a DispatcherServlet HandlerMapping will care for mapping all requests for flows to this controller for
handling.
- Author:
- Keith Donald
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the configured Ajax handler.Returns the central service for executing flows.Returns the flow handler adapter which this Controller uses internally to carry out handler workflow.Returns the configured flow url handler.org.springframework.web.servlet.ModelAndView
handleRequest
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) void
registerFlowHandler
(FlowHandler flowHandler) Registers a flow handler this controller should delegate to to customize the control logic associated with managing the execution of a specific flow.void
setAjaxHandler
(AjaxHandler ajaxHandler) Sets the configured Ajax handler.void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setFlowExecutor
(FlowExecutor flowExecutor) Sets the central service for executing flows.void
setFlowHandlerAdapter
(FlowHandlerAdapter flowHandlerAdapter) Sets the flow handler adapter which this Controller uses internally to carry out handler workflow.void
setFlowHandlers
(Map<String, FlowHandler> flowHandlers) Sets the custom flow handles for managing the access to flows in a custom manner.void
setFlowUrlHandler
(FlowUrlHandler urlHandler) Sets the configured flow url handler.void
setRedirectHttp10Compatible
(boolean redirectHttp10Compatible) Set whether redirects sent by this controller should be compatible with HTTP 1.0 clients.
-
Constructor Details
-
FlowController
public FlowController()Creates a new flow controller.
-
-
Method Details
-
getFlowExecutor
Returns the central service for executing flows. Required. -
setFlowExecutor
Sets the central service for executing flows. Required.- Parameters:
flowExecutor
-
-
getFlowUrlHandler
Returns the configured flow url handler. -
setFlowUrlHandler
Sets the configured flow url handler.- Parameters:
urlHandler
- the flow url handler.
-
getAjaxHandler
Returns the configured Ajax handler. -
setAjaxHandler
Sets the configured Ajax handler.- Parameters:
ajaxHandler
- the ajax handler
-
setRedirectHttp10Compatible
public void setRedirectHttp10Compatible(boolean redirectHttp10Compatible) Set whether redirects sent by this controller 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)
-
setFlowHandlers
Sets the custom flow handles for managing the access to flows in a custom manner.- Parameters:
flowHandlers
- the flow handler map
-
registerFlowHandler
Registers a flow handler this controller should delegate to to customize the control logic associated with managing the execution of a specific flow.- Parameters:
flowHandler
- the handler
-
getFlowHandlerAdapter
Returns the flow handler adapter which this Controller uses internally to carry out handler workflow. -
setFlowHandlerAdapter
Sets the flow handler adapter which this Controller uses internally to carry out handler workflow. Call this instead of the convenience accesors to completely customize flow controller workflow.- Parameters:
flowHandlerAdapter
- the flow handler adapter
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
handleRequest
public org.springframework.web.servlet.ModelAndView handleRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws Exception - Specified by:
handleRequest
in interfaceorg.springframework.web.servlet.mvc.Controller
- Throws:
Exception
-