Interface FlowHandler
- All Known Implementing Classes:
AbstractFlowHandler
public interface FlowHandler
A controller helper used for customizing access to a single flow definition in a Servlet enviroment. This
helper is used to:
- Launch executions of that flow with data in the execution input map
- Handle outcomes reached by that flow in a custom manner
- Handle unhandled exceptions dealing with that flow in a custom manner.
- Author:
- Keith Donald
-
Method Summary
Modifier and TypeMethodDescriptioncreateExecutionInputMap
(jakarta.servlet.http.HttpServletRequest request) Creates the flow execution input map to pass to a new instance of the flow being started.Returns the id of the flow handled by this handler.handleException
(FlowException e, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles a flow exception that was not handled by the Web Flow system.handleExecutionOutcome
(FlowExecutionOutcome outcome, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles a specific flow execution outcome.
-
Method Details
-
getFlowId
String getFlowId()Returns the id of the flow handled by this handler. Used by a Controller to load the flow definition. Optional.- Returns:
- the flow id, or null if the flow id should be determined by the caller
-
createExecutionInputMap
MutableAttributeMap<Object> createExecutionInputMap(jakarta.servlet.http.HttpServletRequest request) Creates the flow execution input map to pass to a new instance of the flow being started. Used by a Controller to launch the flow execution with the correct input.- Parameters:
request
- the current request- Returns:
- the input map, or null if the contents of the input map should be determined by the caller
-
handleExecutionOutcome
String handleExecutionOutcome(FlowExecutionOutcome outcome, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles a specific flow execution outcome. Used by a Controller to get the location of the resource to redirect to after the outcome is handled.The following prefixes are supported for qualifying the returned location string:
- servletRelative: - the location is relative to the current servlet
- contextRelative: - the location is relative to the current web application
- serverRelative: - the location is relative to the server root
For servlet-relative, context-relative, and server-relative URLs, a leading slash is optional.
- Parameters:
outcome
- the outcome that was reachedrequest
- the current requestresponse
- the current response- Returns:
- the location of the new resource to redirect to, or null if the execution outcome was not handled and should be handled by the caller
-
handleException
String handleException(FlowException e, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Handles a flow exception that was not handled by the Web Flow system. Used by a Controller to handle a specific type of exception dealing with this flow in a custom manner.- Parameters:
e
- the unhandled exception originating from Spring Web Flow. May be thrown by the flow execution itself or the flow executor system if no execution could be restored.request
- the current requestresponse
- the current response- Returns:
- the location of the error resource to redirect to, or null if the execution outcome was not handled and should be handled by the caller
-