基于Maven的Mybatis+spring+springMVC框架整合(mapper代理方式)

首先看看整个Demo的骨架:

首先这个demo整合是基于maven的,maven下载配置我就不说了,网上也有很多大神配置的案例,鼠标右键点击new选择maven project。在选择select an Archetype的时候选择webapp,通过myeclipse新建的maven项目只有一个src/main/resources包,所以还要自己手动新建几个src folder、详情请参照上图,接着就是要在pom.xml中添加dependencies,就是所需要的jar包。

 <properties>
        <!-- spring版本号 -->
        <spring.version>3.2.4.RELEASE</spring.version>
        <!-- mybatis版本号 -->
        <mybatis.version>3.2.8</mybatis.version>
        <!-- log4j日志文件管理包版本 -->
        <slf4j.version>1.6.6</slf4j.version>
        <log4j.version>1.2.9</log4j.version>
    </properties>
  <dependencies>
        <!-- spring核心包 -->
        <!-- springframe start -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-beans</artifactId>
		<version>${spring.version}</version>
	</dependency>

	 <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>1.7.1</version>
    </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!-- springframe end -->
		<dependency>
	<groupId>c3p0</groupId>
		<artifactId>c3p0</artifactId>
		<version>0.9.1.2</version>
	</dependency>
        <!-- mybatis核心包 -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>${mybatis.version}</version>
        </dependency>
        <!-- mybatis/spring包 -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
	<groupId>jstl</groupId>
		<artifactId>jstl</artifactId>
		<version>1.2</version>
	</dependency>

        <!-- mysql驱动包 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.29</version>
        </dependency>
        <!-- junit测试包 -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>

        <!-- json数据 -->
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.13</version>
        </dependency>

        <!-- 日志文件管理包 -->
        <!-- log start -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
         <dependency>
		<groupId>asm</groupId>
		<artifactId>asm</artifactId>
		<version>3.3.1</version>
	</dependency>
	<dependency>
		<groupId>cglib</groupId>
		<artifactId>cglib</artifactId>
		<version>2.2.2</version>
	</dependency>
	<dependency>
		<groupId>commons-logging</groupId>
		<artifactId>commons-logging</artifactId>
		<version>1.1.1</version>
	</dependency>
        <!-- log end -->
        <dependency>
	<groupId>org.javassist</groupId>
	<artifactId>javassist</artifactId>
	<version>3.18.1-GA</version>
</dependency>
  <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>3.0-alpha-1</version>
      <scope>provided</scope>
    </dependency>
    </dependencies>

jar包添加好后在src/main/resources/下面新建一个config包,用来装spring、springmvc,mybatis-config配置文件和各种properties文件。

1.配置applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
		http://www.springframework.org/schema/mvc
		http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
		http://www.springframework.org/schema/context
		http://www.springframework.org/schema/context/spring-context-3.2.xsd
		http://www.springframework.org/schema/aop
		http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
		http://www.springframework.org/schema/tx
		http://www.springframework.org/schema/tx/spring-tx-3.2.xsd ">

   <!-- 加载外部的properties配置文件 -->
	<context:property-placeholder location="classpath:jdbc.properties" />
  	<context:component-scan base-package="com.gisquest"/>
   <!-- 配置数据库连接池 -->
   <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
	   <!-- 连接数据库驱动 -->
	   <property name="driverClass" value="${driverClass}"></property>
	   <!-- 数据库url -->
	  <property name="jdbcUrl" value="${jdbcUrl}"></property>
	    <!-- 数据库用户名 -->
	   <property name="user" value="${user}"></property>
	    <!-- 数据库密码-->
	   <property name="password" value="${password}"></property>

	    <!-- 其他配置-->

	   <!--初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。Default: 3 -->
		<property name="initialPoolSize" value="3"></property>
		<!--连接池中保留的最小连接数。Default: 3 -->
		<property name="minPoolSize" value="3"></property>
		<!--连接池中保留的最大连接数。Default: 15 -->
		<property name="maxPoolSize" value="5"></property>
		<!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
		<property name="acquireIncrement" value="3"></property>
		<!-- 控制数据源内加载的PreparedStatements数量。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0 -->
		<property name="maxStatements" value="8"></property>
		<!-- maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。Default: 0 -->
		<property name="maxStatementsPerConnection" value="5"></property>
		<!--最大空闲时间,1800秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
		<property name="maxIdleTime" value="1800"></property>
   </bean>
     <!-- 配置SqlsessionFactory-->
  <bean id="sqlSessionFactory"
		class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="dataSource"/>
		<property name="mapperLocations" value="classpath:mapper/*Mapper.xml"/><!--这里没有用mybatis的配置文件所以在application中扫描Mapper文件,别名也在这配置-->
		<property name="typeAliasesPackage" value="com.gisquest.bean"></property>
   </bean>
 	<!-- mapper扫描器 -->
	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
		<!-- 扫描包路径,如果需要扫描多个包,中间使用半角逗号隔开 -->
		<property name="basePackage" value="com.gisquest.dao"></property>
		<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
	</bean>

	 <!-- 配置事务管理器 -->
    <bean id="transactionManager"
        class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource" />
    </bean>
    <tx:annotation-driven transaction-manager="transactionManager"/>
	</beans>

2.配置springmvc.xml

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
		http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
		http://www.springframework.org/schema/mvc
		http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
		http://www.springframework.org/schema/context
		http://www.springframework.org/schema/context/spring-context-3.2.xsd
		http://www.springframework.org/schema/aop
		http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
		http://www.springframework.org/schema/tx
		http://www.springframework.org/schema/tx/spring-tx-3.2.xsd ">

	<!-- 激活spring注解方式:自动扫描,并注入bean
	 -->
	<context:component-scan base-package="com.gisquest"/>
	<mvc:annotation-driven/>

	<!-- 视图解析器
	解析jsp解析,默认使用jstl标签,classpath下的得有jstl的包
	 -->
	<bean
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<!-- 配置jsp路径的前缀 -->
		<property name="prefix" value="/WEB-INF/pages/"/>
		<!-- 配置jsp路径的后缀 -->
		<property name="suffix" value=".jsp"/>
	</bean>

	<!-- 文件上传 -->
</beans>

因为只是一个demo没有配置文件上传。有需要的可以网上查找也可以联系我。

3.web.xml的配置

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
                      http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
  version="3.1"
  metadata-complete="true">
  <display-name>Archetype Created Web Application</display-name>
  <welcome-file-list>
    <welcome-file>/WEB-INF/pages/index.jsp</welcome-file>
  </welcome-file-list>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext*.xml</param-value>
  </context-param>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <!--  springmvc配置 -->
  <servlet>
  <servlet-name>springmvc</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <init-param>
      <description>spring mvc 配置文件</description>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:springmvc.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>springmvc</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
   <filter>
    <description>字符集过滤器</description>
    <filter-name>encodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <description>字符集编码</description>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>encodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

4.新建一个mapper包放在config包下,新建的mapper.xml都放到该包下,下面是UserMapper.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<!-- namespace命名空间,作用就是对sql进行分类化管理,理解sql隔离
注意:使用mapper代理方法开发,namespace有特殊重要的作用,namespace等于mapper接口地址
-->
<mapper namespace="com.gisquest.dao.UserMapper">

	<!-- sql片段 -->
	<sql id="sql_where_dymatic">
	<if test="username!=null">
	 AND username=#{username}
	</if>
	<if test="address!=null">
	AND address=#{address}
	</if>
	</sql>

	<resultMap type="User" id="aliasResultMap">
	<id column="id_" property="id"/>
	<result column="name_" property="username"/>
	<result column="address_" property="address"/>
	</resultMap>
	<!-- sql综合查询 -->
	<select id="findDynamic" resultType="User" parameterType="map">
	SELECT * FROM user
	<where>
	<include refid="sql_where_dymatic"></include>
	</where>
	</select>
	<!-- 通过id查找 -->
	<select id="findByUserId" resultType="User" parameterType="Long">
		SELECT * FROM user WHERE id=#{id}
	</select>

	<!-- 通过id查找,但是查找的列名是别名 -->
	<select id="findByAlias" resultType="String" parameterType="Long">
		SELECT username name FROM user u WHERE u.id=#{id}
	</select>
	<!-- 通过resultMap输出 -->
	<select id="findByMap" resultMap="aliasResultMap" parameterType="Long">
	SELECT id id_ ,username name_ ,address address_ FROM user u WHERE u.id=#{id}
	</select>
	<!-- 插入数据 -->
	<insert id="insertUser" parameterType="User">
		<!-- 本来主键是自增的,在插入数据时还没有插入主键,所以将插入的主键返回到user对象中 -->
		<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
		SELECT LAST_INSERT_ID()
		</selectKey>
	INSERT INTO user(username,sex,birthday,address) VALUE(#{username},#{sex},#{birthday},#{address})
	</insert>
	<!--  更新数据 -->
	<update id="updateUser" parameterType="User">
	UPDATE user SET username=#{username},sex=#{sex},birthday=#{birthday},address=#{address} WHERE id=#{id}
	</update>

	<delete id="deleteUserById" parameterType="Long">
	DELETE FROM user WHERE id=#{id}
	</delete>
	<resultMap type="User" id="UserOderResultMap">
	<id column="id" property="id"/>
	<result column="username" property="username"/>
	<result column="sex" property="sex"/>
	<result column="birthday" property="birthday"/>
	<result column="address" property="address"/>
	<collection property="ordersList" ofType="Orders">
	<id column="userId" property="userId"/>
	<result column="createtime" property="createtime"/>
	<result column="number" property="number"/>
	<result column="createtime" property="userId"/>
	<result column="note" property="note"/>
	</collection>
	</resultMap>
	<select id="findUserOrderMap" resultMap="UserOderResultMap">
		select user.*,orders.number,orders.note,orders.createtime from orders, user where orders.userId=user.id
	</select>

</mapper>

接下来是UserMapper.java 放在dao的package下:

package com.gisquest.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gisquest.bean.User;
@Repository
public interface UserMapper  {

	public User findByUserId(Long id);

	public void insertUser(User user);
	//更新user
	public void updateUser(User user);
	//删除特定user
	public void deleteUserById(Long id);
	//使用sql片段动态查询
	public List<User> findDynamic(Map paramMap);
	//使用别名查
	public String findByAlias(Long id);
	public User findByMap(Long id);
	//userorders关联查询
	public List<User> findUserOrderMap();
}

接着UserService

/**
* @Project : test Maven Webapp
* @Title : UserService.java
* @Package com.gisquest.service
* @Description :
* @author laiyao
* @Copyright : 2015 zhejiang shine Technology Co. Ltd All right reserved.
* @date 2015年6月26日 下午12:40:45
* @version V1.0
*/
package com.gisquest.service;

import com.gisquest.bean.User;

/**
 * @ClassName: UserService
 * @Description:
 * @author: laiyao
 * @date: 2015年6月26日下午12:40:45
 */
public interface UserService {

	public User findByUserId(Long id);
}

UserServiceImpl:

/**
* @Project : test Maven Webapp
* @Title : UserServiceImpl.java
* @Package com.gisquest.service.Impl
* @Description :
* @author laiyao
* @Copyright : 2015 zhejiang shine Technology Co. Ltd All right reserved.
* @date 2015年6月26日 下午12:42:04
* @version V1.0
*/
package com.gisquest.service.Impl;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gisquest.bean.User;
import com.gisquest.dao.UserMapper;
import com.gisquest.service.UserService;

 /**
 * @ClassName: UserServiceImpl
 * @Description:
 * @author: laiyao
 * @date: 2015年6月26日下午12:42:04
 */
@Service
@Transactional
public class UserServiceImpl implements UserService{
	@Autowired
	private UserMapper userMapper;

	public void findByUserId1() {
		// TODO Auto-generated method stub
		User user=userMapper.findByUserId(1L);
		System.out.println(user);
	}
	/* (non-Javadoc)
	 * @see com.gisquest.service.UserService#findByUserId(java.lang.Long)
	 */
	public User findByUserId(Long id) {
		// TODO Auto-generated method stub
		return userMapper.findByUserId(id);
	}

}

最后controller:

/**
* @Project : test Maven Webapp
* @Title : UserController.java
* @Package com.gisquest.controller
* @Description :
* @author laiyao
* @Copyright : 2015 zhejiang shine Technology Co. Ltd All right reserved.
* @date 2015年6月26日 下午1:43:29
* @version V1.0
*/
package com.gisquest.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.gisquest.bean.User;
import com.gisquest.service.UserService;

/**
 * @ClassName: UserController
 * @Description:
 * @author: laiyao
 * @date: 2015年6月26日下午1:43:29
 */
@Controller
@RequestMapping("")
public class UserController {
	@Autowired
	private UserService userService;

	@RequestMapping(value="/test.html",method=RequestMethod.POST)
	public String show(User user,Model model){
		user=userService.findByUserId(1L);
		model.addAttribute("user", user);
		return"success";
	}
}

大功告成!

时间: 2024-11-07 12:35:46

基于Maven的Mybatis+spring+springMVC框架整合(mapper代理方式)的相关文章

myBatis+Spring+SpringMVC框架面试题整理

myBatis+Spring+SpringMVC框架面试题整理(一) 2018年09月06日 13:36:01 新新许愿树 阅读数 14034更多 分类专栏: SSM 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/qq_41541619/article/details/82459873 目录 ■ SpringMVC 的工作原理 ■ 谈谈你对SpringMVC的理解 ■ SpringMVC

【SpringMVC学习04】Spring、MyBatis和SpringMVC的整合

前两篇springmvc的文章中都没有和mybatis整合,都是使用静态数据来模拟的,但是springmvc开发不可能不整合mybatis,另外mybatis和spring的整合我之前学习mybatis的时候有写过一篇,但是仅仅是整合mybatis和spring,所以这篇文章我系统的总结一下spring.mybatis和springmvc三个框架的整合(后面学习到maven时,我会再写一篇使用maven整合的文章,这篇没有用到maven). 1. jar包管理 我之前有写过一篇spring.hi

SpringMVC学习(四)——Spring、MyBatis和SpringMVC的整合

之前我整合了Spring和MyBatis这两个框架,不会的可以看我的文章MyBatis框架的学习(六)——MyBatis整合Spring.本文我再来讲SpringMVC和MyBatis整合开发的方法,这样的话,Spring.MyBatis和SpringMVC三大框架的整合开发我们就学会了.这里我使用的Spring是Spring4.1.3这个版本(SpringMVC自然也是这个版本),MyBatis是MyBatis3.2.7这个版本. 为了更好的学习SpringMVC和MyBatis整合开发的方法

SSM(MyBatis+Spring+SpringMVC)之MyBatis总结

对于SSM(MyBatis+Spring+SpringMVC)之MyBatis总结 对于ORM持久化框架之前一直是用的JDBC去连接数据库 ,对于JDBC来连接库来说可能存在一些不足,那么MyBatis确切的说只能算半持久化框架,因为MyBatis是需要我们去自动的编写我们的SQL语句的,我们可以用JDBC&MyBatis做一些比较 我们在使用JDBC的时候会对数据库进行一些频繁创建连接和释放连接的操作从而影响的整个系统的性能.那么针对这一方面我们的MyBatis很好的利用了数据库连接池来对我们

spring+springmvc+ibatis整合小结

最近在整合Spring和ibatis时,不管applicationContext.xml放在哪儿,在web.xml中怎么配置,tomcat启动时始终报applicationContext.xml的错.后来查资料后才发现之前的web.xml配置文件没有在<context-param>中指定applicationContext.xml的路径.原来tomcat在加载web.xml时会优先加载<context-param>和<listener>,之后才加载<servlet

Junit与spring TestContext框架整合

所需要的包: junit需要是4.5以上 org.springframework.test-XXX.RELEASE.jar package test; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfigur

Spring mvc 源码 和 Spring+springmvc+hibernate整合源码

本来想着再写下spring+springmvc+hibernate整合的文章 暂时就不写了 直接附上源码,有需要的直接下载看吧.还有前面文章中的springmvc源码  前面文章只是简单的说了下 搭建环境 访问页面成功.这个源码中有模拟的增删改查和文件上传,转换json 实体类验证等功能.有问题可以留言我. http://download.csdn.net/detail/qinyanbin123/8631175 springmvc源码下载地址 http://download.csdn.net/d

SSH框架整合的其它方式

--------------------siwuxie095 SSH 框架整合的其它方式 1.主要是整合 Spring 框架和 Hibernate 框架时,可以不写 Hibernate 核心配置文件:hibernate.cfg.xml 2.把Hibernate 核心配置文件中的配置全都转移到 Spring 核心配置文件中 3.具体实现 applicationContext.xml: <?xml version="1.0" encoding="UTF-8"?&g

基于Maven + SSM (Spring、SpringMVC、Mybatis)构建一个简单的测试项目

最近在公司实习期间的培训交流中有机会接触到SSM,然后自己花费1周的时间投入学习.谈不上深刻理解其中原理,所以没有涉及理论知识,只是浅层次的学习如何使用,在此将学习过程记录整理出来,一方面自己备用:另一方面,分享出来和做技术的各位讨论交流. 现阶段的我还做不到知行合一,所以决定先学会用,然后再去深究原理.若有不足以及错误之处,望多多包涵.指教,谢谢. 废话不多说,直接开干! 1.开发环境搭建 推荐博客地址: MyEclipse+Tomcat+MAVEN+SVN项目完整环境搭建 2.Maven W