File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Does Struts 2 is using IOC Concepts? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Does Struts 2 is using IOC Concepts?" Watch "Does Struts 2 is using IOC Concepts?" New topic
Author

Does Struts 2 is using IOC Concepts?

Sonu Mishra
Greenhorn

Joined: Jan 13, 2008
Posts: 1
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...
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 460
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.


Visit my blog: http://jnassef.blogspot.com/
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

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...
Beppe Catanese
Greenhorn

Joined: Nov 07, 2006
Posts: 27
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Does Struts 2 is using IOC Concepts?
 
Similar Threads
Spring MVC with Hibernate
Using Spring in web app
webwork IOC when compared with ither IOC frameworks
Future competitors of Struts?
Design pattern used in Struts Framework ?