手动配置三大框架整合,Spring+Struts2+Hibernate
运用三大框架,使用MyEclipse帮我们导入jar包会发现有些包冲突了或者有些包是多余的,让我们来手动配置三大框架吧!
1、下载三大框架的必备的jar包,下载地址:http://download.csdn.net/detail/harderxin/4420066
2、新建一个web工程SSHTest,将jar包导入到工程中,注意导入进去后在WEB-INFO目录的lib文件夹中要有相应的jar包,jar包如下
3、打开web.xml,在里面添加如下代码:
//Spring配置
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN""http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"><!-- Mapping file autogenerated by MyEclipse Persistence Tools--><hibernate-mapping> <class name="com.jwjx.beans.DatePlanPri" table="DATEPLAN_PRI" schema="ADMIN"> <id name="rjhmid" type="java.lang.Long"> <column name="RJHMID" /> <generator class="increment" /> </id> <property name="jctype" type="java.lang.String"> <column name="JCTYPE" length="20" /> </property> <property name="jcnum" type="java.lang.String"> <column name="JCNUM" length="20" /> </property> <property name="fixfreque" type="java.lang.String"> <column name="FIXFREQUE" length="20" /> </property> <property name="kcsj" type="java.lang.String"> <column name="KCSJ" length="20" /> </property> <property name="jhqjsj" type="java.lang.String"> <column name="JHQJSJ" length="20" /> </property> </class></hibernate-mapping>