开发环境:
System:Windows
WebBrowser:IE6+、Firefox3+
JavaEE Server:tomcat5.0.2.8、tomcat6
IDE:eclipse、MyEclipse 8
Database:MySQL
开发依赖库:
JavaEE5、Spring 3.0.5、Mybatis 3.0.4、myBatis-spring-1.0、Struts2.2.3、junit4.8.2、ext2.2.2
Email:hoojo_@126.com
Blog:http://blog.csdn.net/IBM_hoojo
上次介绍过Spring3、SpringMVC、MyBatis3整合,在线博文:http://www.cnblogs.com/hoojo/archive/2011/04/15/2016324.html
一、准备工作
1、 下载jar包
Struts2 jar下载:
http://labs.renren.com/apache-mirror//struts/library/struts-2.2.3-lib.zip
Spring3 jar下载:
MyBatis3 jar 下载:http://www.mybatis.org/java.html
2、 添加的jar包如下:
二、Spring、MyBatis整合
1、 需要的jar文件如下:
2、 在src目录中加入mybatis.xml,内容如下:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 别名 -->
<typeAliases>
<typeAlias type="com.hoo.entity.Account" alias="account"/>
</typeAliases>
</configuration>