从Struts 1迁移到Struts 2 [英] Migration from Struts 1 to Struts 2

查看:168
本文介绍了从Struts 1迁移到Struts 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划使用Struts 1代码库迁移到Struts 2。我没有得到任何好的资源来继续这次迁移。你能帮忙解决这个问题吗?

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?

推荐答案

S1用S2会有点过分。两个框架都很复杂,因此维护成本增加了两倍或更多。因此,策略是完全迁移到S2。

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.

两个框架都实现了MVC模式。将应用程序划分为应分别迁移的三个部分:模型,控制器和视图。订单并不重要,但逻辑上暗示遵循MCV订单。您可能不会更改的模型,Controller部分需要重写配置,View是最困难的部分,您必须将S1标签重写为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.


将Struts 1.x迁移到Struts 2.x:

您可以在 struts1插件下使用Struts1操作。另请考虑>阅读现有的迁移指南解决方案,以及策略>可能会帮助您完成迁移过程。可以通过惯例插件轻松完成映射操作。您不能在Struts2中使用Struts1 JSP标记,但如果您使用相同的应用程序运行这两个框架,则可以在Struts1中使用它。

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.








将Struts与Spring集成:

正确和最新的方法是迁移到Struts2。如果
关注Struts被弃用的原因,你可以阅读这篇
文章: Struts死了吗?第三部分:我无法杀死Struts(Struts是
已弃用)David Geary

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迁移指南:

  • Migrating Struts Apps to Struts 2 - Part I
  • Migrating to Struts 2 - Part II
  • Migrating to Struts 2 - Part III

这篇关于从Struts 1迁移到Struts 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆