SpringMVC+MyBatis+Freemarker 简单框架搭建(一)
一、开发环境:
Eclipse、Tomcat、SVN等请参见如下的帖子,很详细了。
http://www.iteye.com/topic/982182
svn和maven插件的安装:
1、先安装gef插件
地址:http://download.eclipse.org/tools/gef/updates/interim/
2、安装svn插件
地址:http://subclipse.tigris.org/update_1.6.x
3、maven插件
m2eclipse-core Update 地址: http://m2eclipse.sonatype.org/sites/m2e
m2eclipse-extras Update 地市: http://m2eclipse.sonatype.org/sites/m2e-extras
4、安装可能出现的问题
直接在线安装maven2 会出现依赖插件找不到的问题,无法安装。必须先安装gef 插件后才能安 装m2eclipse-core 插件,然而安装m2eclipse-extras 插件又依赖subclipse 插件。所以,三个插 件的正确的安装顺序是:gef插件 》subclipse插件 》m2eclipse插件
二、web.xml 和 applicationContext.xml 配置
1、web.xml文件配置:
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
2、applicationContext.xml 内容如下:
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
">
p:configLocation = "classpath:sqlMapConfig.xml" />
3、web.xml中的
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">