How to identify the URL mapping for invoking Spring web flow

512 Views Asked by At

I have just started with Spring Web Flow. I have a basic doubt. In case of Spring MVC, the @RequestMapping contains the URL mapping, say for eg, @RequestMapping("/home"), this means, when the URL nodeContent is /home, the Contorller with @RequestMapping("/home") will be delegated by the dispatcher servlet. In case of Spring Web Flow, how is this mapping done? I mean, how do we even identify the request URL? is it the flow-location id in flow-registry? Basically, I want to know how to identify that when a Spring web flow is invoked based on what kind of URL request? eq- "https://stackoverflow.com/questions/ask", if this URL has to invoke a flow, how is the mapping done with the URL /ask. Please can anyone answer this?

1

There are 1 best solutions below

1
Rashed On

The main thinks is, there are two beans which is complete the mapping. First of all,

FlowHandlerMapping : in general, DispatcherServlet know the request mapping by handler mapping, but in WebFlow, FlowHandlerMapping helps DispathcerServlet to know the mapping. Basically it's "flow-registry". When hit the url, then it's get the url with the id. now it's ready to execute the flow.

FlowHandlerAdapter : When the executable flow url is ready then it's try to load the flow file with id like

configure-flow.xml

Once you successfully get the path then flow will start. The flow will continue until view-state to end-state.

Maintain the order of your view page, because next flow will come in order. If you have any question, leave in comment section.