struts2.0 升级到 struts2.1.2 更改的配置项(一)
来源:互联网 发布:淘宝搬家到另一个店铺 编辑:程序博客网 时间:2024/05/15 00:51
struts2.0 升级到 struts2.1.2 更改的配置项(一)(2008-11-06 18:12:15)标签:struts2.1.2 struts2.0 ajaxtags
Troubleshooting guide migrating from Struts 2.0.x to 2.1.x
About the Migration guide
This guide describes how to migrate an existing Struts 2.0.x application to Struts 2.1.x. It is intended to be read from top to bottom but you may skip-ahead to known problems and common exceptions. Please edit this page or provide comments if you encounter additional issues.
Update Dependencies
Update your project dependences to use struts2-core-2.1.x and the plugins struts2-core-2.1.x.
There have been significant changes to the Configuration API between 2.0 and 2.1. Third-party plugins for 2.0 may not be compatible with 2.1.x.
Maven users can update their project's pom.xml to reference the new core and plugin versions. Ensure no dependencies in the freemarker groupId are used as the latest version used by Struts is now under the org.freeemarker groupId and will cause classpath conflicts.
If you need releases not considered General Availability you can use a staging repository where they are usually available:
<repositories> <repository> <id>struts2.1.2-staging</id> <name>Struts 2.1.2 staging repository</name> <layout>default</layout> <url>http://people.apache.org/builds/struts/2.1.2/m2-staging-repository/</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>
Non-Maven users can can download the jars and dependencies in a Distribution 2.1.2
DELETE OLD VERSIONS NOW: It's essential that old versions of the jars are removed from your project as well as the deployment directories. Don't trust your IDE to delete unused versions.
eg. Your application is now be dependent on xwork-2.1.x, not xwork-2.0.x. Ensure xwork-2.0.x is completely removed or you will encounter compile-time and run-time exceptions.
Update Custom Type Converters
If your project implements custom type converters you may need to change the imports statements to use the com.opensymphony.xwork2.conversion package. Failing to do so will cause a compile-time error.
Before:
import com.opensymphony.xwork2.util.TypeConversionException;
After:
import com.opensymphony.xwork2.conversion.TypeConversionException;
Update struts.xml Configuration
Results and Interceptors have been renamed to use camelCase instead of hyphenated names (eg. now redirectAction instead of redirect-action).
Review all custom interceptor stacks, interceptor refs and results in struts.xml and remove the hyphen.
Interceptors:
From To
external-ref externalRef
model-driven modelDriven
static-params staticParams
scoped-model-driven scopedModelDriven
servlet-config servletConfig
token-session tokenSession
Results:
From To
redirect-action redirectAction
plaintext plainText
Forgetting to rename an interceptor or result reference will prevent your WebApp from starting. The following is a typical stacktrace for an invalid result type.
SEVERE: Exception starting filter struts2 Unable to load configuration. - action - file:/home/giaz/code/.metadata/.plugins/ com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:370) ... Caused by: Error building results for action ScheduleJob in namespace - action - file:/home/giaz/code/.metadata/.plugins/
.addAction(XmlConfigurationProvider.java:372) ... 30 more Caused by: There is no result type defined for type 'redirect-action' mapped with name 'success' - result -
- struts2.0 升级到 struts2.1.2 更改的配置项(一)
- struts2.0 升级到 struts2.1.2 更改的配置项(三)
- struts2升级到2.5的配置
- struts2.0升级到struts2.1.6遇到的问题汇总
- struts2.0升级到struts2.1
- struts2.0升级到struts2.3.20
- struts2的配置一
- 关于struts2.3.4升级到struts2.3.15.2的问题
- Struts2.0升级到2.3出现的一些问题
- Struts2升级 配置修改
- struts2 2.2 升级到 struts2 2.3.15
- struts2.1.6升级到struts2.3.15.1
- struts2.1.6升级到struts2.3.15.1
- struts2.3.23升级到struts2.3.32
- Struts2高位漏洞升级到struts2.3.32
- struts2.3升级到struts2.5
- struts2.0升级struts2.3.3
- struts2.0升级struts2.3.3
- Spring数据源配置
- struts2.1.2 版本 ajaxtags及其他插件的更改(二)
- 图说adore-ng之端口隐藏
- Hibernate中用hql查询部分字段
- SQL重复记录查询
- struts2.0 升级到 struts2.1.2 更改的配置项(一)
- 面试时最难回答的25个问题
- Ubuntu系统下安装JDK——不管是不是root管理员身份
- 技术高手的十三个原则
- 如何在Tomcat 6.0中建立虚拟目录!!!
- 如何评估CIO工作效果
- 如果能让嵌入式开发也步入互联网时代。。。
- php获得文件名后缀的方法
- 面试常问到的经典100问 附答案和点评 参加过面试的人就知道这些题目出现的频率有多高啦 ①