File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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

Which is better Struts 2.0 vs Spring and Why

Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689

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

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

Joined: Apr 12, 2005
Posts: 690
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.

Srinivasa Kadiyala
Ranch Hand

Joined: Jun 10, 2004
Posts: 237

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.

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: 471

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:
I agree. Here's the link:
subject: Which is better Struts 2.0 vs Spring and Why
It's not a secret anymore!