maven构建spring mvc项目 + Mybatis整合(2)

发表于:2013-11-29来源:Csdn作者:Abel-Lin点击数: 标签:软件测试
1.1.1 jar compile mysql mysql-connector-java 5.1.21 jar compile org.freemarker freemarker 2.3.19 javax.servlet servlet-api 2.5 provided org.slf4j slf4j-api ${slf4j.version} org.slf4j slf4j-log4j12 ${s

  1.1.1

  jar

  compile

  

  

  

  mysql

  mysql-connector-java

  5.1.21

  jar

  compile

  

  

  org.freemarker

  freemarker

  2.3.19

  

  

  javax.servlet

  servlet-api

  2.5

  provided

  

  

  org.slf4j

  slf4j-api

  ${slf4j.version}

  

  

  org.slf4j

  slf4j-log4j12

  ${slf4j.version}

  

  

  log4j

  log4j

  1.2.16

  

  

  

  springProject

  

  

  

  org.mortbay.jetty

  maven-jetty-plugin

  6.1.25

  

  

  org.mybatis.generator

  mybatis-generator-maven-plugin

  1.3.1

  

  src/main/resources/mybatis-generator.xml

  true

  

  

  

  

  

  2、web.xl

  [html] view plaincopy

  

  xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

  version="2.5">

  springProject Application

  

  

  contextConfigLocation

  

  classpath:applicationContext.xml

  

  

  

  

  org.springframework.web.context.ContextLoaderListener

  

  

  

  org.springframework.web.util.WebAppRootListener

  

  

  

  spring

  org.springframework.web.servlet.DispatcherServlet

  

  contextConfigLocation

  /WEB-INF/spring-servlet.xml

  

  

  1

  

  

  spring

  /

  

  

  

  3、spring-servlet.xml

  [html] view plaincopy

  

  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"

  xsi:schemaLocation="http://www.springframework.org/schema/beans

  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

  http://www.springframework.org/schema/mvc

  http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd

  http://www.springframework.org/schema/context

  http://www.springframework.org/schema/context/spring-context-3.0.xsd">

  

  

  

  

  

  

  

  

  

  

  

  

  

  

  class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"

  lazy-init="false">

  

  

  

  

  

  

  

  class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">

  

  

  

  

  

  

  

  

  /WEB-INF/views/

  

  

  

  

  auto_detect

  0

  UTF-8

  UTF-8

  zh_CN

  true,false

  yyyy-MM-dd HH:mm:ss

  yyyy-MM-dd

  HH:mm:ss

  0.##

  true

  true

  

  

  

  

  

  

  

  

  4、applicationContext.xml

  [html] view plaincopy

  

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"

  xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc"

  xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"

  xsi:schemaLocation="http://www.springframework.org/schema/beans

原文转自:http://blog.csdn.net/rongku/article/details/13053455