Struts2

To configure PicoContainer to handle the dependency injection of Struts2 actions, refer to the web.xml below. For a start there is a slightly different listener to the one defined in the main page. Also, instead of using Struts2's servlet, use ours. Everything else from the standard Struts2 setup is appropriate.

	
	  Struts 2 Webapp

	  
	    webapp-composer-class
	    org.picocontainer.web.sample.ExampleWebappComposer
	  

	  
	    picoFilter
	    org.picocontainer.web.struts2.PicoObjectFactory$ServletFilter
	  

	  
	    strutsFilter
	    org.apache.struts2.dispatcher.FilterDispatcher
	  

	  
	    picoFilter
	    /*
	  

	  
	    strutsFilter
	    /*
	  

	  
	    org.picocontainer.web.struts2.Struts2PicoServletContainerListener
	  

	  
	    index.html
	  

	

The Maven example project is here. Make sure you make and configure your own WebappComposer implementation.

See downloads on how to download the struts2 module either using Maven or by downloading full distribution.