• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Dependency Injection in struts 2.0

 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me where exactly the dependency injection comes into picture in struts 2.0?

Thanks.
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

Thanks Much!
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
See where your hand is? Not there. It's next to this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic