gpt4 book ai didi

java - 从 Struts 1 迁移到 Struts 2

转载 作者:搜寻专家 更新时间:2023-10-31 08:23:00 26 4
gpt4 key购买 nike

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

最佳答案

S1 和 S2 会矫枉过正。两种框架都很复杂,因此维护成本会增加两倍或更多时间。因此,策略是完全迁移到 S2。

两个框架都实现了 MVC 模式。将应用程序划分为三个应单独迁移的部分:模型、 Controller 和 View 。顺序并不重要,但逻辑上暗示要遵循 MCV 顺序。 Model你可能不会改变,Controller部分需要重写配置,View是最难的部分,你必须将S1标签重写为S2标签。

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 youconcern the things why Struts is deprecated, you might read thisarticle: Is Struts Dead? Part III: I can't kill Struts (Struts isDeprecated) David Geary.


InfoQ Migration Guide:


关于java - 从 Struts 1 迁移到 Struts 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20127369/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com