Can Spring Web Flow Work in Non Spring MVC application?

I am working on evaluating Spring Web Flow for handling conversational flows in the web application that is currently used. Currently, the web application that we are using using is a custom company made MVC framework that was developed 10+ years back when there was no Spring MVC or Struts etc. There is a ControllerServlet in the application which is currently doing the work of managing the requests, similar to DispatcherServlet of Spring MVC.

Now, we want to take advantage of the Spring Web Flow features and renew the application and ease the developers life. I would like to know from all you people out here who had similar experiences in the past of migrating legacy MVC application to Spring Web Flow.

Please suggest the configurations and / or changes which I should be looking at to take this into right direction.

Some of the questions which come naturally to my mind are:

  • Configuration changes to web.xml? or adding a spring related xml file?
  • Any changes that we need to make to the JSP's? I am assuming Spring Web Flow will require me to make changes in the JSP's. What do you guys feel?
  • How could we get rid of the ControllerServlet? or better yet ask the ControllerServlet to refer to Spring Web-Flow for all the requests?
  • If Spring Web Flow is replacing the ControllerServlet, what happens to all the code that is written in it? what equivalenet of Spring Web Flow do we need to write?
  • Thanks, Yogendra


    Why replace, you can perfectly use Spring Web Flow (and/or Spring MVC for that matter) alongside your own MVC framework. You only have to be careful when you are crossing boundaries between the 2.

    What we did in such a scenario was introduce a DispatcherServlet for only handling the Spring Web Flow request and everything else was handled as before. So you basically have 2 servlets instead of 1.

    Another solution would/could be to replace your own servlet with a DispatcherServlet and let all requests for the old part of the application delegate to your own ControllerServlet , for this you could use the ServletWrappingController of Spring MVC.

    Benefit of the last approach is that you could create a HandlerInterceptor which could move some stuff around from your own MVC framework to SWF and vice-versa.

    In each and every car you would need to change the pages that use Spring Web Flow to use the Spring tag libraries so that form can be properly handled, for pages that aren't used/served by Spring Web Flow everything can remain the same.

    链接地址: http://www.djcxy.com/p/39098.html

    上一篇: Spring MVC问题

    下一篇: Spring Web Flow可以在非Spring MVC应用程序中工作吗?