• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring MVC over existing Sturts project

 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have a web project that was done with Sturts. I am doing some enhancments to this project (adding a few new screens and new functionality).

Would it be possible to do these enhancements in Spring MVC although it is a Struts project? Would there be any conflicts between the Spring and Struts components and files?

Thanks for any advice.
 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
To me it doesn't make much sense to switch from MVC framework to another(in your case Struts to SpringMVC) just for a few new screens and enhancements.

But you can make use of Spring's Dependency Injection (IoC) container and Spring's Action support by using Struts with just Spring Core(instead of Spring MVC).

Regards,
Paras
[ November 13, 2008: Message edited by: Paras Jain ]
 
Jehan Jaleel
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply and advice. I understand what you are saying.

The reason I want to use Spring MVC is because for the enhacements I am doing I want to reuse some code and some JSPs that were already done for another Spring MVC project.

My concern is would there be any conflict between Struts and Spring MVC. Would some web containers not like it?

Thanks.
 
Paras Jain
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I think Spring and Struts could co-exist, but I have hardly seen such combination. And yes as you said, containers may do some funny things because of possible conflicts at some places
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bot can co-exist, you can even integrate Spring with your Struts Action. To do that you have your Action extend ActionSupport from Spring, which extends Struts Action class, but also has the nice ability to access the Application Context that you load when deploying your war file.

For both co-existing, is that the URLs that are already using Struts, keep them using Struts, but for new URLs, map tham in Spring to Spring MVC Controller classes instead of Struts Action classes.

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic