My application is about 80% Spring MVC, but I have a fair amount of code that uses Webflow. I'm currently using a Spring MVC SimpleUrlHandlerMapping to dispatch to the webflow, which I know isn't how I'm "supposed" to do it.
My flow definitions are defined as follows:
- /WEB-INF/flows/process1/reservation/reservation-flow.xml
- /WEB-INF/flows/process1/modify/modify-flow.xml
- /WEB-INF/flows/process2/reservation/reservation-flow.xml
- /WEB-INF/flows/process2/modify/modify-flow.xml
I want to be able to access them via the following URLS:
- http://example.com/context/process1/reservation/reservation.html
- http://example.com/context/process1/modify/modify.html
- http://example.com/context/process2/reservation/reservation.html
- http://example.com/context/process2/modify/modify.html
My flow registry bean looks like this:
<webflow:flow-registry id="flowRegistry" base-path="WEB-INF/flows" flow-builder-services="flowBuilderServices" >
<webflow:flow-location-pattern value="/**/*/*-flow.xml"/>
</webflow:flow-registry>
My javascript to dispatch to the webflow looks like this (javascript snippet, it's a very complex page):
var form = $('<form action="${pageContext.request.contextPath}/process1/reservation/reservation.html" method="POST">');
form.append('<input name="param1" value="' + record.param1 + '" />');
form.append('<input name="param2" value="' + record.param2 + '" />');
form.append('</form>');
submitForm(form);
Now for the real question: How do I set up a url handler mapping for it, whether it be SimpleUrlHandlerMapping
or something else?
Thanks!
SimpleUrlHandlerMapping
instead ofFlowHandlerMapping
, the way you're "supposed" to do it? If I understand correctly what you're asking, shouldn'tFlowHandlerMapping
give you what you want? – dbreauxDefaultFlowUrlHandler
javadoc describes that it will ignore extensions in determining the flow ID.) – dbreaux