• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Does Struts 2 is using IOC Concepts?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I am using Struts 1.2. I want to know that Struts 2 is more like Spring. Does it Using IOC? How Struts 2 is more Customizable?

Thanks for your replies friends...
 
Ranch Hand
Posts: 471
Mac OS X Hibernate Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Sonu,

Struts 2 is a web application framework (like struts). As far as I know, struts 2 doesn't have it's own IoC, but rather provide a plugin to use spring's IoC.
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Historically, WebWork uses its own DI container but recently it dropped it in favor of Spring as the default container.
And as Struts2 is based on WebWork2 code base, I think Spring is the DI container for Struts2 too.
Any way, waiting for experienced opinion...
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It does, as previous reply confirms Struts2 is based on WebWork which has IoC. Specifically Struts2 supports interface injection where basically the Action (no longer implementing an interface but they are just standard POJOs) can be injected with the HttpSession, HttpServletRequest, etc..
The result is the decoupling of the Action classes with the Java Servlet API and much simple unit testing.
 
reply
    Bookmark Topic Watch Topic
  • New Topic