一、整合原理二、导包(41个)1.hibernate(1)hibernate/lib/required (2)hibernate/lib/jpa | java persist api java的持久化规范(接口) (3)数据库驱动 2
一、整合原理
二、导包(41个)
1.hibernate
(1)hibernate/lib/required
(2)hibernate/lib/jpa | java persist api java的持久化规范(接口)
(3)数据库驱动
2.struts2
(1)struts-blank.war/WEB-INF/lib/*
注意:javassist-3.18.1-GA.jar包与hibernate中的重复(只保留高版本即可)
注意:这个包一旦导入,那么struts2在启动时就会寻找spring容器.找不到将会抛出异常
3.spring
(1)基本:4+2
core | beans | context | expression | logging | log4j
(2)整合web:web包
spring-web
(3)整合aop:4个
spring-aop | spring-aspect | aop联盟 | aopweaving
(4)整合Hibernate和事务:4个
spring-jdbc | spring-tx | c3p0 | spring-ORM
(5)整合junit4测试:test包
spring-test
4.标签库
standard.jar | jstl-1.2.jar
三、单独配置spring容器
1.创建applicationContext.xml,并导入约束(4个) beans | context | aop | tx
<?xml version="1.0" encoding="UTF-8"?><beans xmlns:xsi="Http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd "> <bean name="userAction" class="cn.xyp.web.action.UserAction"></bean></beans>
--结束END--
本文标题: 详解JAVAEE——SSH三大框架整合(spring+struts2+hibernate)
本文链接: https://lsjlt.com/news/225054.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0