yhmisday05.zip

项目结构

SSM整合 - 图1

pom.xml


4.0.0
com.kai
yhmisday04-springMVC
0.0.1-SNAPSHOT
war


4.10
4.1.3.RELEASE
3.2.8
1.2.2
5.1.32
1.1.6
1.6.4
1.2
2.5
2.0
2.4.2




junit
junit
${junit.version}
test



org.springframework
spring-webmvc
${spring.version}


org.springframework
spring-jdbc
${spring.version}


org.springframework
spring-aspects
${spring.version}



org.mybatis
mybatis
${mybatis.version}


org.mybatis
mybatis-spring
${mybatis.spring.version}



mysql
mysql-connector-java
${mysql.version}



com.alibaba
druid
${druid.version}


org.slf4j
slf4j-log4j12
${slf4j.version}



com.fasterxml.jackson.core
jackson-databind
${jackson.version}



jstl
jstl
${jstl.version}


javax.servlet
servlet-api
${servlet-api.version}
provided


javax.servlet
jsp-api
${jsp-api.version}
provided





org.apache.tomcat.maven
tomcat7-maven-plugin
2.2

8060
/




web.xml

<?xml version=”1.0” encoding=”UTF-8”?>
xmlns=”http://java.sun.com/xml/ns/javaee
xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
id=”yhmis” version=”2.5”>
yhmis

  1. <context-param>


contextConfigLocation

classpath:spring/applicationContext*.xml


org.springframework.web.context.ContextLoaderListener

  1. <servlet>


springmvc
org.springframework.web.servlet.DispatcherServlet


contextConfigLocation
classpath:spring/springmvc-config.xml



springmvc

/

  1. <filter>


encodingFilter
org.springframework.web.filter.CharacterEncodingFilter


encoding
utf8



encodingFilter

/*

mybatis-config.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">


applicationContext.xml

xmlns:context=”http://www.springframework.org/schema/context“ xmlns:p=”http://www.springframework.org/schema/p
xmlns:aop=”http://www.springframework.org/schema/aop“ xmlns:tx=”http://www.springframework.org/schema/tx
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">











xmlns:context=”http://www.springframework.org/schema/context“ xmlns:p=”http://www.springframework.org/schema/p
xmlns:aop=”http://www.springframework.org/schema/aop“ xmlns:tx=”http://www.springframework.org/schema/tx
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">




value=”classpath:mybatis/mybatis-config.xml”>

ref=”dataSource”>

value=”classpath:mybatis/mapper/*.xml”/>

value=”cn.tedu.pojo”>






springmvc-config.xml

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



base-package=”cn.tedu.controller”>