Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring

 
Ken Cole
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ahmad,

I apologize if this question has already been asked, but what are the advantages to using Spring over Struts?

The majority of my development projects have used Struts with the exception of one project which used Spring, Hibernate, Ajax and JSF.

Also, do you see them as competing technologies where one will eventually fall by the wayside and can you give an example of when you would want to integrate Struts with Spring and use both technologies? (I can't think of any reason why you would want to use both in the same project).

Thanks,

Ken Cole

 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are many advantages of Spring -

Dependency injection
AOP
Transaction management are few

if you care for spring web services - I like the contract first interface

We had to integrate Struts with Spring on many projects primarily because of time! - The entire project was in Struts but the new reusable libraries and transactions were developed in Spring for a different project. Rather than write the code again in Struts we decided to interface them. It is easy to start the Spring container and reap benefits of transaction management.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book is about Spring, persistence, and Hibernate--not about Spring MVC, which is the part of Spring comparable to Struts.

I have used Struts, both Struts 1 and Struts 2, with Spring for almost every project I've ever done. Some were originally Struts projects that I integrated Spring into for the DI and persistence/tx mgmt. I prefer Struts 2 over Spring MVC (although Spring 3 might convince me otherwise), but use Struts 2's Spring integration for action instantiation/DI.

I have used Spring pretty extensively, but my MVC layer is still usually Struts 2.
 
praneeth ram
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main diffarence between spring and struts is

By Using Struts we can develop only webapplications.

but By using Spring we can develop any type of applications.that my be stand alone applications,web,enterprise,distributed..etc.
for this one only spring contains 6modules.like spring core,spring aop,spring j2ee,...etc

but in struts there is no such type of moduls.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nor is there supposed to be--as I said, Struts is equivalent to Spring MVC.
 
Babji Reddy
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring provides an additional layer 'web flow' that gives ability to web applications to have a 'conversational state/scope' in addition to the the standard page,request and session scopes from J2EE.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic