• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Spring

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nor is there supposed to be--as I said, Struts is equivalent to Spring MVC.
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic