Spring : Struts integration

This page last changed on Feb 08, 2006 by Kees de Kooter

Attempt to write a cookbook on using struts with the spring framework.

  1. Add spring's ContextLoaderListener to the web.xml to kickstart the spring context on application startup (for 2.4 servlet engines, for 2.3 and lower use the ContextLoaderServlet servlet).

  2. Define actions of type org.springframework.web.struts.DelegatingActionProxy in the struts-config.xml.

  3. Define a spring bean for every action with the same name as the action.

  4. Create the proper setters for spring to inject its beans into.

And you are in business!!