This commit is contained in:
Keith Donald
2008-04-23 19:07:31 +00:00
parent 42af342d00
commit 9dae1e69a4

View File

@@ -38,10 +38,12 @@ import org.springframework.webflow.executor.FlowExecutor;
*/
public class FlowController extends AbstractController implements InitializingBean {
private FlowHandlerAdapter flowHandlerAdapter;
private FlowHandlerAdapter flowHandlerAdapter = new FlowHandlerAdapter();
private Map flowHandlers = new HashMap();
private boolean customFlowHandlerAdapter;
/**
* Creates a new flow controller.
* @see #setFlowExecutor(FlowExecutor)
@@ -130,24 +132,24 @@ public class FlowController extends AbstractController implements InitializingBe
*/
public void setFlowHandlerAdapter(FlowHandlerAdapter flowHandlerAdapter) {
this.flowHandlerAdapter = flowHandlerAdapter;
customFlowHandlerAdapter = true;
}
public void afterPropertiesSet() throws Exception {
if (flowHandlerAdapter == null) {
flowHandlerAdapter = new FlowHandlerAdapter();
if (!customFlowHandlerAdapter) {
flowHandlerAdapter.setApplicationContext(getApplicationContext());
flowHandlerAdapter.afterPropertiesSet();
}
}
// subclassing hooks
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
throws Exception {
FlowHandler handler = getFlowHandler(request);
return flowHandlerAdapter.handle(request, response, handler);
}
// subclassing hooks
// internal helpers
private FlowHandler getFlowHandler(HttpServletRequest request) {