文档详情

Struts2、Spring3、MyBatis3整合ExtJS_-_ColumnTree.docx

发布:2017-08-04约3.35万字共37页下载文档
文本预览下载声明
Struts2、Spring3、MyBatis3整合ExtJS,完成ColumnTree开发环境:System:WindowsWebBrowser:IE6+、Firefox3+JavaEE Server:tomcat、tomcat6IDE:eclipse、MyEclipse 8Database:MySQL开发依赖库:JavaEE5、Spring 3.0.5、Mybatis 3.0.4、myBatis-spring-1.0、Struts2.2.3、junit4.8.2、ext2.2.2Email:hoojo_@126.comBlog:/IBM_hoojo/上次介绍过Spring3、SpringMVC、MyBatis3整合,在线博文:/hoojo/archive/2011/04/15/2016324.html准备工作下载jar包Struts2 jar下载:/apache-mirror//struts/library/struts-2.2.3-lib.zipSpring3 jar下载:/repository/app/library/version/detail?name=org.springframework.springversion=3.0.5.RELEASEMyBatis3 jar 下载:/java.html添加的jar包如下:Spring、MyBatis整合需要的jar文件如下:在src目录中加入mybatis.xml,内容如下:?xmlversion=1.0encoding=UTF-8?!DOCTYPEconfigurationPUBLIC-////DTD Config 3.0//EN/dtd/mybatis-3-config.dtdconfiguration!-- 别名 --typeAliasestypeAliastype=com.hoo.entity.Accountalias=account//typeAliases/configuration上面的配置文件中,可以加入一些公共、常用的MyBatis方面的全局配置。如handler、objectFactory、plugin、以及mappers的映射路径(由于在applicationContext-common中的SqlSessionFactoryBean有配置mapper的location,这里就不需要配置)等。这个类的文件名称和下面的applicationContext-common.xml中的configLocation中的值对应,不是随便写的。在src目录中添加applicationContext-common.xml中加入内容如下:?xmlversion=1.0encoding=UTF-8?beansxmlns=/schema/beansxmlns:aop=/schema/aopxmlns:tx=/schema/txxmlns:xsi=/2001/XMLSchema-instancexsi:schemaLocation=/schema/beans /schema/beans/spring-beans-3.0.xsd /schema/aop /schema/aop/spring-aop-3.0.xsd /schema/tx /schema/tx/spring-tx-3.0.xsd !-- 配置DataSource数据源 --beanid=dataSourceclass=org.springframework.jdbc.datasource.DriverManagerDataSourcepropertyname=driverClassNamevalue=com.mysql.jdbc.Driver/propertyname=urlvalue=jdbc:mysql://31:3306/ash2/propertyname=usernamevalue=dev/propertyname=passwordvalue=dev//bean!-- 配置SqlSessionFactoryBean --beanid=sqlSessionFactoryclass=org.mybatis.spring.SqlSessionFactoryBeanpropertyname=dataSourceref=dataSource/propertyname=configLocationvalue=classpath:mybatis.xml/!-- mapper和resultmap配置路径 --propertyname=mapperLocationslist!-- 表示在com.hoo.resultmap包或以下所有目录中,以-resultmap.xml结尾所有文件 --valueclasspath:co
显示全部
相似文档