多语言展示
当前在线:1691今日阅读:155今日分享:35

Spring Struts Hibernate三大框架整合详细步骤

目录:      1,加三大框架的--顺序--核心包--以及细节      2, 建库建表建约束
工具/原料

开发工具(myEclipse等等),三大框架的jar包,

方法/步骤
1

一,加 三大框架 的--顺序--核心包--以及细节 注意:还要配置,数据库 [ 那个JDBC 。。。??? ]First,Hibernate 3.3:  一个(core)核心包   【如果要原注释,就加一个 Annotation】生成一个hibernate.xml 配置文件        【show_sql  ;  formart_sql】 Second,Spring 3.0:5个包:前三个{AOP(控制反转吗);Core(核心);Persistence()} 再加两个【Testing(测试);Web(网站)】生成一个applicationContext.xml 配置文件 Third, Struts 2.1: 两个包{struts2 核心包;Struts2 - Spring-Libraries}生成一个 struts2.xml 配置文件

2

Fourth,删除jar包;【5个jar包】 删除步骤:如下……window--> prefences--》输入框【输入 struts】--》找到struts 2-->进入本地目录引用--》删除第一个antlr-2.7.2.jar(remove)--》apply (允许)同意修改;【另一个是 还原】   A:  antlr-2.7.2.jar 依照上述方法:找到--Spring--删除 2.5 系列  B:  删除Spring2.5xx.jar 【此系列的jar包都要删掉】

3

启动项目前:配置web.xml 【监听器 和 一个文件 】           contextConfigLocation      classpath:applicationContext.xml             org.springframework.web.context.ContextLoaderListener  

4

二,建库建表建约束:的方式如下……【1,在数据库中:建库建表建约束,在项目中反向生成 实体类】【2,在<项目>中:建实体类,反向生成表,约束,】 Lib导入的jar包,有【是做什么的】commons-beanutils-1.7.0.jarcommons-collections.jarcommons-lang-2.1.jarcommons-logging.jardozer-4.2.jarojdbc14_g.jarstruts2-junit-plugin-2.3.4.1.jarstruts2-testng-plugin-2.3.4.1.jar 包里面,分层,1,  反向生成:com.accp.pojo2,帮助包:  com.accp.util3,异常处理: com.accp.exception4,展示的类: vo5,数据访问层:dao,daoImpl;  业务逻辑层:biz ,bizImpl6,处理:action【struts.xml配置文件   和   Spring配置文件】7,测试层:test

注意事项

仔细看步骤,按照顺序操作,记得删除jar包!

推荐信息