现在使用Spring4来整合Struts2和Hibernate4.
Struts2.3.16,Spring4.0.6,Hibernate4.3.5 整合所需jar 包:
Struts2.3.6所需jar包:
Spring4.0.6所需jar包:
Hibernate4.3.5所需jar包:
本地安装的是mysql数据库,还要添加mysql驱动包:mysql-connector-java-3.1.12-bin.jar
1.新建dynamic web project工程:S2SH
2.把所需的jar包粘贴到lib目录下:
3.配置web.xml文件为:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>S2SH</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- 添加对spring的支持 -->
<context-param>
<param-name>contextConfigLocation&