Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Which is better Struts 2.0 vs Spring and Why

 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 701
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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 ]
 
Ranch Hand
Posts: 471
Mac OS X Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic