---
title: "可以开始用Struts2.0了"
author: "robbin"
date: "2007-02-27T14:56:35Z"
tags: []
categories: ["企业架构"]
slug: "struts2-0"
draft: false
lastmod: "2007-02-27T14:56:35Z"
id: 56252
url: "https://robbin.iteye.com/blog/56252"
---

http://struts.apache.org/

Apache已经发布了Struts2.0的正式版，即2.0.6GA版本。这个版本已经可以在项目中正式使用了。当然大家一定很关心，从webwork2.2迁移到struts2.0麻烦不麻烦，请看Struts2.0的FAQ：


> Essentially, Struts 2.0 is the technical equivalent of WebWork 2.3. Aside from the package and property renaming, it isn't much different than, say, migrating from WebWork 2.1 to 2.2.


Struts2.0其实就是webwork2.3而已，从webwork2.2迁移到struts2.0不会比从webwork2.1到2.2更麻烦。

webwork2.2和struts2.0差异对比：
http://struts.apache.org/2.x/docs/key-changes-from-webwork-2.html

迁移步骤：
http://struts.apache.org/2.x/docs/webwork-2-migration-strategies.html

总结：

大致来说，struts2.0就是把package和配置文件的名字改了改而已，别的没有做什么改动，所以现在用struts2.0和用webwork2.2没有多大区别。当然这迁移一迁就是将近两年，还是有点进步的：

1、搭配struts2.0的xwork版本必须使用xwork2.0.1，而xwork2.0.1集成了可选的Google Guice IoC容器
2、Struts2.0弄了一个plugin机制，来适配各种扩展机制
3、全面引入annotation语法，验证，拦截都可以用annotation了。

所以用webwork的同志们，大胆的迁移到struts2.0来吧。