0

我最近不得不将 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)

有人可以解释一下吗?

4

1 回答 1

1

您需要执行redirect:orforward:来启动流程。

于 2013-10-20T09:40:02.120 回答