思维导图(基本配置) 1. 需要引入的包 2 .spring-config.xml 的配置 <!-- 链接数据库 外部配置文件扫入 --> <context:property-override location="classpath:db_orcl.properties" /> <!-- 扫描器 --> <!-- service , dao , 的实现类 和 action类 由spring 管理 --> <context:compo…
项目说明: 使用SSH(Spring SpringMVC Hibernate)框架整合添加部门功能 项目结构   1.导入依赖jar包 <!--单测--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.3</version> <scope>test</scope> </…
使用Maven+Spring+Struts2+Hibernate整合 pom文件 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd…
一:基本步骤 新建Maven项目,导入相关依赖(推荐) 在WEB-INF的web.xml中进行配置 ————–Hibernate配置 —————- 创建entity包,创建数据库相关实体类 根据实体类创建**.hbm.xml映射文件(移动到resources/mapper下)或者直接使用hibernate注解 ——–Spring整合Hibernate配置 ———- 在resources下创建spring文件夹,新建spring-dao.xml,添加二者整合配置. ————Spring Servi…
搭建Spring 1.porm.xml中添加jar包 <!-- spring3 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>3.1.2.RELEASE</version> </dependency> <dependency> &l…
package org.springframework.orm.hibernate3; import java.io.Serializable; import java.util.List; import org.springframework.orm.hibernate3.HibernateTemplate; @SuppressWarnings("rawtypes") public interface BaseDao<T> { HibernateTemplate getH…
错误提示: org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity org.hibernate.MappingException: Unknown entity 原因: Spring的applicationContext.xml文件缺少mappings映射文件 配置方法: 在applicationContext.xml文件的bean的id为sessionFactory的目录下添加property <p…
SSH框架版本:Struts-2.3.30  +  Spring-4.2.2  +  Hibernate5.2.2 下图是所需要的Jar包: 下面是项目的结构图: 1.web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://jav…
1.搭建过程 首先需要引入Spring.Struts2.Hibernate的开发包,已经数据库的驱动包. UserAction.java文件 package cn.shop.action; import java.io.IOException; import java.util.List; import javax.annotation.Resource; import org.apache.struts2.convention.annotation.Action; import org.apa…
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersi…