《大框架整合步骤》word版

《大框架整合步骤》word版

ID:24313467

大小:50.01 KB

页数:3页

时间:2018-11-13

《大框架整合步骤》word版_第1页
《大框架整合步骤》word版_第2页
《大框架整合步骤》word版_第3页
资源描述:

《《大框架整合步骤》word版》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、Struts2.1.6+Spring2.5.6+Hibernate3.3.21.需要的jar包列表jar包名称所在位置说明antlr-2.7.6.jarhibernate/lib/required解析HQLaspectjrtspring/lib/aspectjAOPaspectjweaver..AOPcglib-nodep-2.1_3.jarspring/lib/cglib代理,二进制增强common-annotations.jarspring/lib/j2ee@Resourcecommons-collec

2、tions-3.1.jarhibernate/lib/required集合框架commons-fileupload-1.2.1.jarstruts/libstrutscommons-io-1.3.2struts/libstrutscommons-logging-1.1.1单独下载,删除1.0.4(struts/lib)strutsspringdom4j-1.6.1.jarhibernate/required解析xmlejb3-persistencehibernate-annotation/lib@Entit

3、yfreemarker-2.3.13struts/libstrutshibernate3.jarhibernatehibernate-annotationshibernate-annotation/hibernate-common-annotationshibernate-annotation/libjavassist-3.9.0.GA.jarhiberante/lib/requiredhibernatejta-1.1.jar..hibernatetransactionjunit4.5mysql-ognl-

4、2.6.11.jarstruts/libslf4j-api-1.5.8.jarhibernate/lib/requiredhibernate-logslf4j-nop-1.5.8.jarhibernate/lib/requiredspring.jarspring/diststruts2-core-2.1.6.jarstruts/libxwork-2.1.2.jarstruts/libstruts2commons-dbcpspring/lib/jarkata-commonscommons-pool.jar..

5、struts2-spring-plugin-2.1.6.jarstruts/lib2.BestPractice:a)将这些所有的jar包保存到一个位置,使用的时候直接copy3.步骤a)加入jar包b)首先整合Spring+Hibernatei.建立对应的package1.dao/dao.impl/model/service/service.impl/testii.建立对应的接口与类框架1.S2SH_01iii.建立spring的配置文件(建议自己保留一份经常使用的配置文件,以后用到的时候直接copy改)i

6、v.建立数据库v.加入Hibernate注解1.在实体类上加相应注解@Entity@Id等2.在beans配置文件配置对应的实体类,使之受管vi.写daoservice的实现vii.加入Spring注解1.在对应Service及DAO实现中加入@Component,让spring对其初始化2.在Service上加入@Transactional或者使用xml方式(此处建议后者,因为更简单)3.在DAO中注入sessionFactory4.在Service中注入DAO5.写DAO与Service的实现viii.

7、写测试c)整合Struts2i.结合点:Struts2的Action由Spring产生ii.步骤:1.修改web.xml加入struts的filter2.再加入spring的listener,这样的话,webapp一旦启动,spring容器就初始化了3.规划struts的action和jsp展现4.加入struts.xmla)修改配置,由spring替代struts产生Action对象5.修改action配置a)把类名改为bean对象的名称,这个时候就可以使用首字母小写了b)@Scope(“prototyp

8、e”)不要忘记iii.struts的读常量:1.struts-default.xml2.struts-plugin.xml3.struts.xml4.struts.properties5.web.xmliv.中文问题:1.Struts2.1.8已经修正,只需要改i18n.encoding=gbk2.使用spring的characterencoding3.需要严格注意filter的顺序1.需要加到Struts2的f

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。