Migration from Struts 1 to Struts 2

26,461

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:


Share:
26,461
user3018534
Author by

user3018534

Updated on July 09, 2022

Comments

  • user3018534
    user3018534 almost 2 years

    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?

  • SME_Dev
    SME_Dev over 5 years
    Some of the links are dead.
  • RotBot
    RotBot over 2 years
    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.