三大框架整合步驟培訓資料_第1頁
三大框架整合步驟培訓資料_第2頁
三大框架整合步驟培訓資料_第3頁
三大框架整合步驟培訓資料_第4頁
三大框架整合步驟培訓資料_第5頁
已閱讀5頁,還剩3頁未讀, 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、Good is good, but better carries it.精益求精,善益求善。三大框架整合步驟-Struts2.1.6+Spring2.5.6+Hibernate3.3.2需要的jar包列表jar包名稱所在位置說明antlr-2.7.6.jarhibernate/lib/required解析HQLaspectjrtspring/lib/aspectjAOPaspectjweaver.AOPcglib-nodep-2.1_3.jarspring/lib/cglib代理,二進制增強common-annotations.jarspring/lib/j2eeResourcecommons

2、-collections-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/libEntityfreemarker-2.3.13struts/libstrutshibe

3、rnate3.jarhibernatehibernate-annotationshibernate-annotation/hibernate-common-annotationshibernate-annotation/libjavassist-3.9.0.GA.jarhiberante/lib/requiredhibernatejta-1.1.jar.hibernatetransactionjunit4.5mysql-ognl-2.6.11.jarstruts/libslf4j-api-1.5.8.jarhibernate/lib/requiredhibernate-logslf4j-nop

4、-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.struts2-spring-plugin-2.1.6.jarstruts/libBestPractice:將這些所有的jar包保存到一個位置,使用的時候直接copy步驟加入jar包首先整合Spring+Hibernate建立對應的packagedao/d

5、ao.impl/model/service/service.impl/test建立對應的接口與類框架S2SH_01建立spring的配置文件(建議自己保留一份經常使用的配置文件,以后用到的時候直接copy改)建立數據庫加入Hibernate注解在實體類上加相應注解EntityId等在beans配置文件配置對應的實體類,使之受管寫daoservice的實現加入Spring注解在對應Service及DAO實現中加入Component,讓spring對其初始化在Service上加入Transactional或者使用xml方式(此處建議后者,因為更簡單)在DAO中注入sessionFactory在Se

6、rvice中注入DAO寫DAO與Service的實現寫測試整合Struts2結合點:Struts2的Action由Spring產生步驟:修改web.xml加入struts的filter再加入spring的listener,這樣的話,webapp一旦啟動,spring容器就初始化了規劃struts的action和jsp展現加入struts.xml修改配置,由spring替代struts產生Action對象修改action配置把類名改為bean對象的名稱,這個時候就可以使用首字母小寫了Scope(“prototype”)不要忘記struts的讀常量:pertiesweb.xml中文問題:Struts2.1.8已經修正,只需要改i18n.encoding=gbk使用spring的characterencoding需要嚴格注意filter

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論