WebWork2

To configure PicoContainer to handle the dependency injection of WebWork2 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 WebWork2's servlet, use ours. Everything else from the standard WebWork2 setup is appropriate.

	
	  PicoContainer-Web WebWork 2 Demo

	  
	    webapp-composer-class
	    *your web app composer class name*
	  

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

	  
	    picoFilter
	    *.action
	  

	  
	    org.picocontainer.web.webwork2.WebWork2PicoServletContainerListener
	  

	  
	    action
	    com.opensymphony.webwork.dispatcher.ServletDispatcher
	  

	  
	    action
	    *.action
	  

	  
	    index.html
	  

	  
	    webwork
	    /WEB-INF/webwork.tld
	  

	


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

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

We have a sample application. It is a small form-style web-app that shows and list of cheeses, allows you to add and delete from the list. See the Maven2 source for it. Here is a screenshot of it running:

Download the war file for it (full Java source in WEB-INF/classes).