File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can Struts 1 and 2 coexist in the same web application?
 
Similar Threads
Struts 2 Question
How to use, struts 1-- struts-config.xml and struts 2 -- struts.xml together?
coexistence of struts 1 and struts 2 web application
Session problem between JSP and Struts
struts-core-2.0.11.2.jar on two places on the server