2
我的應用程序大約80%是Spring MVC,但我有相當多的使用Webflow的代碼。我目前正在使用Spring MVC SimpleUrlHandlerMapping發送到webflow,我知道這並不是我「應該」這樣做的方式。從Spring MVC調度到Spring Webflow
我的流定義定義如下:
- /WEB-INF/flows/process1/reservation/reservation-flow.xml
- /WEB-INF /流/過程1 /修改/修改 - flow.xml
- /WEB-INF/flows/process2/reservation/reservation-flow.xml
- /WEB-INF/flows/process2/modify/modify-flow.xml
我想是可以通過以下URL來訪問它們:
- 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
我的流量註冊表豆看起來是這樣的:
<webflow:flow-registry id="flowRegistry" base-path="WEB-INF/flows" flow-builder-services="flowBuilderServices" >
<webflow:flow-location-pattern value="/**/*/*-flow.xml"/>
</webflow:flow-registry>
我的JavaScript來分派到一個Webflow看起來像這樣(JavaScript片段,這是一個非常複雜的頁面):
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);
現在對於真正的問題:如何建立一個URL處理程序映射它,無論是SimpleUrlHandlerMapping
還是別的?
謝謝!
因此,您應該使用'SimpleUrlHandlerMapping'而不是'FlowHandlerMapping',這是您「應該」這樣做的原因嗎?如果我正確地理解了你所要問的,不應該用'FlowHandlerMapping'給你想要的東西? – dbreaux
正如@dbreaux提到的那樣,有沒有什麼特別的推理背後沒有使用FlowHandlerMapping.Also,您是否探索過使用子流並在流映射配置文件中添加更多轉換。 –
我沒有使用FlowHandlerMapping的原因是它從來沒有爲我工作。 在我的基本路徑,我想有這樣的: /process1/reservation/reservation.xml 我預計映射到: http://example.com/context/process1/reservation/reservation。 html 但沒有運氣。 – Jason