Overview
The NanoWar WebWork integration kit allows you to write WebWork/WebWork2 actions that are PicoContainer components. In other words, they can benefit from Dependency Injection.
Example
WebWork actions often integrate with business logic and/or persistence logic. In a non-Dependency Injection environment, the actions tend to be tightly coupled to the business logic and persistence layer tiers, and therefore hard to test in isolation.
NanoWar WebWork lets you use Dependency Injection.
The particularly nice thing about this is that it allows you to test the Action in isolation (by passing in a mock CheeseDao). And when you deploy the WebWork application, you can have NanoContainer provide the real CheeseDao (that possibly does some fancy Hibernate stuff or other).
WebWork Specific Configuration
First, follow the instructions for NanoWar
WebWork 1.x Configuration
Use the PicoServletDispatcher instead of the standard WebWork one. In web.xml:
WebWork 2.0 Configuration
Use the PicoServletDispatcher instead of the standard WebWork 2 one. In web.xml:
WebWork 2.1 Configuration
Map ServletRequestContainerFilter and PicoObjectFactoryFilter to WebWork's ServletDispatcher. In web.xml:
Do not use the PicoServletDispatcher when using WebWork 2.1
