Hello, Dependency injection in Struts action classes can be used to inject dependencies such as business delegates and other helper classes. Even you can inject some configuration properties as well in the Struts action classes. There three ways to achieve this 1) Using Spring Action Support classes. 2) Using DelegatingRequestProcessor 3) Using DelegatingActionProxy = I have used this one earlier in one of the projects. This is the best way suggested to use DI in struts. In this approach you declare map the type attribute in action-mappings to the spring class DelegatingActionProxy and declare the action class as spring beans in spring configuration file. Thnx amit
posted 13 years ago
I am a bit confused with the explanations of the Dependency Injection. Can anyone please explain the IOC or dependency Injection concept with an example or point me to some good links where I can get a clear picture of the same and how it's used in the struts 2.0 framework(probably with some live examples).
If you don't understand the concept of IOC very well, my advice would be to forget about Struts 2 for a while and concentrate on learning IOC in the context of Spring. Then once you have a good handle on that, work on how to integrate with Struts 2. [ June 21, 2007: Message edited by: Merrill Higginson ]