Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Architecture & Framework  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 struts2升级到2.3.15.1总结
阿熊

阿熊

元老


发贴: 5644
积分: 454
于 2013-07-22 19:00 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
一、struts2.1版本之后就对el表达式不支持了,页面会抛出异常。
解决方法:el表达式最好更改为ongl表达

二、Struts2表单字段处理
1、校验更加严格,不处理空格问题,会导致后台取不到相应的表单值,抛出NullPointException的错误
2、定义form的value object时,get,set方法后面第一个字母需要大写,不然无法赋值

三、Xwork中ActionContext的方法变更
1、Struts2.3版本中,ActionContext中的一个方法的参数发生了变更,所以所有引用这个方法的java文件需要依赖新包重新编译
2、在pom.xml添加依赖需要将最新的包放在dependencies标签的首位吧

四、Struts2forward方式配置的变更
struts的forward typeredirect-action改成redirectAction
老的方式<resultname="forward" type="redirect-action">
新的方式<resultname="forward" type="redirectAction">



作者 struts2.1.x升级到struts2.3.x [Re:阿熊]
阿熊

阿熊

元老


发贴: 5644
积分: 454
于 2013-07-22 20:58 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
升级所需修改的包删除

struts2-convention-plugin-2.1.x.1.jar

struts2-core-2.1.x.1.jar

struts2-embeddedjsp-plugin-2.1.x.1.jar

struts2-json-plugin-2.1.x.1.jar

struts2-spring-plugin-2.1.x.1.jar

xwork-core-2.1.8.jar

ognl-2.7.3.jar

添加

xwork-core-2.3.4.1.jar

struts2-json-plugin-2.3.4.1.jar

struts2-embeddedjsp-plugin-2.3.4.1.jar

struts2-core-2.3.4.1.jar

struts2-spring-plugin-2.3.4.1.jar

struts2-convention-plugin-2.3.4.1.jar

ognl-3.0.5.jar

commons-lang3-3.1.jar

***ist-3.11.0.GA.jar

若将asm.jar改为asm-3.3.jar

需添加asm-tree-3.3.jar

asm-commons-3.3.jar

同时修改cglib-2.1.3为cglib-2.2



同时将:

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher

</filter-class>

修改为

<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

</filter-class>
-



作者 Struts 2.3.15.1最基本的5个包 [Re:阿熊]
阿熊

阿熊

元老


发贴: 5644
积分: 454
于 2013-07-22 21:04 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
commons-logging-api-1.1.jar
Apache Commons包中的一个,Commons Logging应用接口,一种超薄适配器允许其他可配置桥连接

freemarker-2.3.19.jar
FreeMarker是一个用Java语言编写的模板引擎,它基于模板来生成文本输出。FreeMarker与Web容器无关,即在Web运行时,它并不知道Servlet或HTTP。它不仅可以用作表现层的实现技术,而且还可以用于生成XML,JSP或Java 等。

ognl-3.0.6.jar
OGNL是Object-Graph Navigation Language的缩写,它是一种功能强大的表达式语言(Expression Language,简称为EL),通过它简单一致的表达式语法,可以存取对象的任意属性,调用对象的方法,遍历整个对象的结构图,实现字段类型转化等功能。它使用相同的表达式去存取对象的属性。

struts2-core-2.3.15.1.jar
xwork-core-2.3.15.1.jar
Struts 2是Struts的下一代产品,是在 struts 1和WebWork的技术基础上进行了合并的全新的Struts 2框架。其全新的Struts 2的体系结构与Struts 1的体系结构差别巨大。Struts 2以WebWork为核心,采用拦截器的机制来处理用户的请求,这样的设计也使得业务逻辑控制器能够与ServletAPI完全脱离开,所以Struts 2可以理解为WebWork的更新产品。虽然从Struts 1到Struts 2有着太大的变化,但是相对于WebWork,Struts 2的变化很小。


阿熊 edited on 2013-07-22 21:12


flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923