1) Struts Actions Are Roughly Spring Controllers
Actions are abstract classes (extends Action@@) and Controllers are interfaces. In order to be configured as a Spring MVC controller, an object would need only to implement the following method:
ModelAndView handleRequest (HttpServletRequest request, HttpServletResponse response); # pushmail
the simplest intermediary transition step from Struts to Spring is to rewrite Actions so they implement the Controller interfaces and reuse the existing code. This allows incremental removal of all the Struts dependencies while the application remains operational.
Some of the supplied Controllers match the more specialized Struts Actions with which you may be familiar. For instance, if you use DispatchActions, MultiActionControllers and the more elaborate AbstractWizardFormControllers will be helpful. About a dozen different Controller implementations come with Spring MVC, so it is well worth exploring their purposes and how they can replace your Struts mechanisms.
2) ActionForwards -> ModelAndView
closest component in Spring MVC to ActionForward is the ModelAndView interface. Spring Controllers return implementations of the ModelAndView interface, which, like a Controller, can be custom implemented. Or, if appropriate, you can use the ModelAndView implementations supplied by Spring MVC.
As the name implies, ModelAndView objects have Model and View components. Model components contain the business object to be displayed via the View component. ModelAndView implementations may not have any Model components included. They may simply forward into some form of an actual View component (JSP, XSLT, Tiles, HTML, XML, etc.). As with Controller implementations, I strongly recommend researching Spring MVC-supplied implementations of the Model and View interfaces and View Resolvers.
*) afbean (actionForm beans) have no direct counterpart
*) spring taglig is much smaller than struts 4 taglibs (html, logic, bean ….)
*) loginAction.java -> loginController.java
*) struts “action path=..” -> simpleUrlMapping to map a request URL to loginController
*) struts “forward name=..” -> viewResolver to translate a logical view name to a URL
*) struts-config.xml -> yourDisplatcher-servlet.xml (WAC4DS) + auxiliary config files
*) execute() -> handleRequest()