Migration from Struts 1 to Struts 2
Asked Answered
T

1

10

I am planning to migrate to the Struts 2 with the Struts 1 code base. I am not getting any good source to proceed on this migration. Could you please help on this approach?

Tel answered 21/11, 2013 at 17:3 Comment(5)
It seems impossible the way you proceed.Kizzee
The question is kind of the same here no ? #7817823Nonessential
@Nonessential you are wrong, it's not a migration question it's integration one more over S2 into S1 that is absolute absurd.Kizzee
Thanks Roman for the response. But if you refer the below link where it is mentioned we can run S2 and S1 together please advise.... struts.apache.org/release/2.0.x/docs/migration-strategies.htmlTel
@Tel No, the strategy is in below answer, you should accept the answer, because it's only one of the famous guides of migrating S1 to S2. It's helped a lot of people, including me and I shared it on SO for people who have problems in migration. You should not follow some pages of S2 docs that are outdated, instead follow links in my answer, you need to have good experience in both frameworks to succeed.Kizzee
K
14

S1 with S2 it will overkill. Both frameworks are complicated, so the maintenance costs increase twice or more time. So, the strategy is to migrate completely to S2.

Both frameworks are implemented MVC pattern. Divide the application on three parts that should migrate separately: Model, Controller, and View. The order is not important, but logically is implied to follow the MCV order. The Model you'd probably not change, the Controller part requires to rewrite the configuration, the View is most difficult part, you have to rewrite S1 tags to S2 tags.

Migrating Struts 1.x to Struts 2.x:

You can use Struts1 actions under the struts1 plugin. Also consider to read the existing migration guide, solutions, and strategy that might help you in the migration process. Mapping actions could be easily done via convention plugin. You can't use Struts1 JSP tags with Struts2, but you can use it in Struts1 if you are running both frameworks with the same application.


Integrate Struts with Spring:

The right and up-to-date approach is to migrate to Struts2. If you concern the things why Struts is deprecated, you might read this article: Is Struts Dead? Part III: I can't kill Struts (Struts is Deprecated) David Geary.


InfoQ Migration Guide:


Kizzee answered 21/11, 2013 at 20:5 Comment(3)
Some of the links are dead.Kit
The Struts 1 Plugin is no longer supported in Struts 2.5. Looks like all Struts 1 actions will have to be rewritten if migrating past Struts 2.3.37.Kandrakandy
@Kandrakandy Struts 2.5.* branch is already deprecated themselves. Always use the latest version.Kizzee

© 2022 - 2024 — McMap. All rights reserved.