public class FlowHandlerMapping
extends org.springframework.web.servlet.handler.AbstractHandlerMapping
HandlerMapping
that follows a simple convention for
creating URL path mappings from the ids of registered flow definitions
.
This implementation returns a FlowHandler that invokes a flow if the current request path matches the id of a flow in
the configured FlowDefinitionRegistry
. Alternatively, a custom FlowHandler
may also be registered
with in containing ApplicationContext with that id and it will be returned. This allows for more control over the
invocation of a flow from Spring MVC environment.
Null is returned in the case of no flow id match, allowing the next handler mapping in the chain to execute.Constructor and Description |
---|
FlowHandlerMapping() |
Modifier and Type | Method and Description |
---|---|
protected FlowHandler |
createDefaultFlowHandler(java.lang.String flowId)
Factory method that returns the default flow handler for the flow with the given id.
|
FlowDefinitionRegistry |
getFlowRegistry()
Returns the registry of flows to query when this mapping is tested.
|
FlowUrlHandler |
getFlowUrlHandler()
Returns the configured flow url handler.
|
protected java.lang.Object |
getHandlerInternal(javax.servlet.http.HttpServletRequest request) |
protected void |
initServletContext(javax.servlet.ServletContext servletContext) |
void |
setFlowRegistry(FlowDefinitionRegistry flowRegistry)
Sets the registry of flows to query when this mapping is tested.
|
void |
setFlowUrlHandler(FlowUrlHandler flowUrlHandler)
Sets the flow URL handler, which allows customization for how the flow id is determined for each request tested
by this mapping.
|
adaptInterceptor, detectMappedInterceptors, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getUrlPathHelper, initApplicationContext, initInterceptors, setAlwaysUseFullPath, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, isContextRequired, setServletContext
public FlowDefinitionRegistry getFlowRegistry()
public void setFlowRegistry(FlowDefinitionRegistry flowRegistry)
flowRegistry
.flowRegistry
- the flow definition registrypublic FlowUrlHandler getFlowUrlHandler()
public void setFlowUrlHandler(FlowUrlHandler flowUrlHandler)
DefaultFlowUrlHandler
.flowUrlHandler
- the flow URL handlerprotected void initServletContext(javax.servlet.ServletContext servletContext)
initServletContext
in class org.springframework.web.context.support.WebApplicationObjectSupport
protected java.lang.Object getHandlerInternal(javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
getHandlerInternal
in class org.springframework.web.servlet.handler.AbstractHandlerMapping
java.lang.Exception
protected FlowHandler createDefaultFlowHandler(java.lang.String flowId)
flowId
- the id of the flow to handle invocation of