• 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

conversion of struts to spring

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on converting an application from struts to spring. Since it is a big app, it is planned to release it phased manner, where in few pages will first be launched in spring, and then few others pages, like that. I can convert jsp, bean, action classes etc. But is it actually possible to change the controller for certain flow alone to spring and keeping the controller for certain other pages in struts itself. How will the app work then?

Please throw some light, as I am new to Spring
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it is possible for a struts controllers and spring controllers to live in the same webapplication. The JSPs will need to be changed when you migrate to spring. You will have to make sure that the same JSP is not being called from both struts and spring controllers, because then it can get complicated.

The bigger challenge you might face is that you might want to share the backend code between struts and spring controllers. THe way we did it is we moved the backend code to Spring first without moving the controllers. The Struts controllers would get the beans from Spring context. Then we moved Struts controllers to Spring controllers
 
vysh sri
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what should I give in web.xml. It can be only either of the below, right?

Struts



Spring

 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can put both. I don;t know whether you are familiar with Servlet spec. It helps to learn Servlets first before you get into Struts/Spring. the URL pattern in the servlet mapping tag determines which requests go to which servlet. You just need to make sure that the URL pattern is set correctly so requests for Spring go to spring servlet, and requests for struts go to struts servlet.
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic