JSF

JSF binds to PicoContainer-Web quite well.

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

	
	  PicoContainer-Web JSF Demo

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

	  
	    picoFilter
	    org.picocontainer.web.jsf.PicoVariableResolver$ServletFilter
	  

	  
	    picoFilter
	    *.jsf
	  

	  
	    org.picocontainer.web.PicoServletContainerListener
	  

    
	
		Faces Servlet
		javax.faces.webapp.FacesServlet
		1
	
	
	
		Faces Servlet
		*.jsf
		


	  
	    index.html
	  

	
	

With this design you can use Constructor Injection and three tier container scoping for JSF web applications. Make sure you make and configure your own WebappComposer implementation.

See downloads on how to download the webwork 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).