wood burning stoves 2.0*
The moose likes Other Application Frameworks and the fly likes Which is better Struts 2.0 vs Spring and Why Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Which is better Struts 2.0 vs Spring and Why" Watch "Which is better Struts 2.0 vs Spring and Why" New topic
Author

Which is better Struts 2.0 vs Spring and Why

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688

Hi All,

Can any one tell me Which framework is better Struts 2.0 vs Spring and Why.

In which condition both usefull and how to use.

now I am working on Struts 2.0 + hibernate . My point of view Struts 2.0 is easy to understand and rapid development framework compare to Spring.

please guide me.

Thanks In Advanced
Nishan


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689
I think it depends of your requirements. If you are satisfied with Struts 2, why don't you keep with it? Why changing to something new if your requirements are satisfied with your current framework?
Many times we have the feeling that some other framework is better than the one we are using, but we must consider all the effort we should spend if we wanna change our application to other technology.


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237
Hi

I have not used struts 2.0 but I used 1.x versions.

I have moved to Spring after that. But in my opinion, we should move on to Spring as it has more than MVC to do.

Struts is not an alternate to the EJBs where as Spring is an alternate.

Some one can correct me if I am wrong.


Srini
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Struts is not an alternate to the EJBs where as Spring is an alternate.


Spring is still a MVC-based Presentation framework. It is not an alternative to Enterprise JavaBeans. Spring has more support to working with Model code, Struts has none.

The supporting Spring code for the Model is not an alternative to a business object model. These are only supporting objects that help you integrate your business object model with your presentation code.

A Spring-based web application should connect to a POJO or EJB-based business model application in order to execute business logic. If business logic is coded in any of the Spring objects, then the Spring framework is being used incorrectly.

Spring is favored over Struts because of these supporting objects that help integrate the presentation component with the business component.

However, Spring does not present a framework for implementing business/domain logic. It helps you create a Controller and a View for your application, no Model though. EJB is still a great option for implementing the business/domain object model.
[ October 08, 2008: Message edited by: James Clark ]
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
We should standardize our definitions first. Spring is a fully fledged application framework, that has a large stack of sub projects. One of the projects is spring MVC, which is a web framework and certainly better than struts 1.x in every way. As for struts 2, which is based on web work, it's also a great solution, and has its advantages over spring MVC (and disadvantages as well).

As for spring, if we look at its history, it started as an effort for supplying a solution for enterprise java applications, and to replace EJBs (while it also provided integration with EJBs for people who didn't want to ditch that). Spring is much more than an MVC framework. It provides dependency injection, AOP, integration with almost every known framework, a security framework (a separate sub-project), and a lot of other stuff. Struts 2 and hibernate integrate easily with spring, so you might like to add it to your stack, without ditching struts 2


Visit my blog: http://jnassef.blogspot.com/
 
 
subject: Which is better Struts 2.0 vs Spring and Why