*
The moose likes Struts and the fly likes Can Struts 1 and 2 coexist in the same web application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Can Struts 1 and 2 coexist in the same web application?" Watch "Can Struts 1 and 2 coexist in the same web application?" New topic
Author

Can Struts 1 and 2 coexist in the same web application?

Scott Ellis
Greenhorn

Joined: Oct 03, 2011
Posts: 4
I've started a new job where there is existing code written using the Struts 1 framework. They are open to upgrading to Struts 2, but there exists a substantial amount of code that I would rather not have to migrate right now. If that is the only choice, then it will be considered. But, is there a way to deploy a single web application using both an old Struts 1 application with a Struts 2 application running simutaneously? Keep in mind too that there is a login screen to this application, so the HttpSession has to be the same for both apps.

I've not done much with Struts in the past, so the answer may be obviously no if the web.xml configuration has overlapping tag values.

Thanks for your help.

Scott
Scott Ellis
Greenhorn

Joined: Oct 03, 2011
Posts: 4
Looks like I found my own answer on the apache struts web site. Here is the applicable section:

Dual processor, shared resources - Add the Struts 2.0 JARs to your exisitng Struts 1.3 application. Configure S2 to handle
*.action requests s and let S1 handle
*.do requests. S1 and S2 can run side by side, within the same web application. Teams can implement new features in the latest version, and migrate older pieces as needed. Optionally, some common resources may be shared between S1 and S2, like messages, validation rules, and Tiles configurations, making for an even smoother migration.


Clear as a bell.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can Struts 1 and 2 coexist in the same web application?