我最近不得不将Web流的第一步移出直接Web流逻辑,然后将其放在一个单独的控制器中。所以过去的步骤是:
File jsp/stuff/flow.xml:
<view-state id="startFlow" model="flowModel" view="flow/start" ></view-state>
现在应该像这样:
Controller Startup.java:
@RequestMapping("mything.html")
public String startFlow(Model model) {
return "jsp/stuff";
}
当转到(localhost)/ MyApp / jsp / stuff时,流程就开始了。就在控制器发送给你的时候,你会遇到这个丑陋的错误:
javax.servlet.ServletException: Could not resolve view with name 'jsp/stuff' in servlet with name 'MyApp'
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1190)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:827)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
有人可以解释一下吗?
答案 0 :(得分:1)
您需要执行redirect:
或forward:
来启动流程。