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:
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问题