SSM整合所需要的配置文件

pom.xml




org.springframework
spring-context
5.0.5.RELEASE


org.aspectj
aspectjweaver
1.8.7


org.springframework
spring-jdbc
5.0.5.RELEASE


org.springframework
spring-tx
5.0.5.RELEASE


org.springframework
spring-test
5.0.5.RELEASE


org.springframework
spring-webmvc
5.0.5.RELEASE



javax.servlet
servlet-api
2.5


javax.servlet.jsp
jsp-api
2.0



org.mybatis
mybatis
3.4.5


org.mybatis
mybatis-spring
1.3.1


mysql
mysql-connector-java
5.1.6


c3p0
c3p0
0.9.1.2


junit
junit
4.12


jstl
jstl
1.2


ssm


src/main/java

/*.properties
/.xml

false


src/main/resources

**/
.properties
**/*.xml

false





maven-clean-plugin
3.0.0



maven-resources-plugin
3.0.2


maven-compiler-plugin
3.7.0


maven-surefire-plugin
2.20.1


maven-war-plugin
3.2.0


maven-install-plugin
2.5.2


maven-deploy-plugin
2.8.2




web.xml


contextConfigLocation
classpath:applicationContext.xml


org.springframework.web.context.ContextLoaderListener



DispatcherServlet
org.springframework.web.servlet.DispatcherServlet

contextConfigLocation
classpath:spring-mvc.xml

1


DispatcherServlet
/



CharacterEncodingFilter
org.springframework.web.filter.CharacterEncodingFilter

encoding
UTF-8



CharacterEncodingFilter
/*

applicationContext所需的配置文件

< ?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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">


<context:component-scan base-package="com.itheima">

<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"></context:exclude-filter>
</context:component-scan>


<context:property-placeholder location="classpath:jdbc.properties"></context:property-placeholder>




















<tx:advice id="txAdvice">
tx:attributes
<tx:method name="*"/>
</tx:attributes>
</tx:advice>


aop:config
<aop:advisor advice-ref="txAdvice" pointcut="execution(* com.itheima.service.impl..(..))"></aop:advisor>
</aop:config>
< /beans>

spring-mvc所需的配置文件

< ?xml version="1.0" encoding="UTF-8" ?>
< beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
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.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">


<context:component-scan base-package="com.itheima.controller"></context:component-scan>

mvc:annotation-driven</mvc:annotation-driven>






mvc:default-servlet-handler</mvc:default-servlet-handler>

< /beans>

sqlMapConfig-spring.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>





< /configuration>

posted @ 2020-10-06 17:37  02zerotwo  阅读(232)  评论(0)    收藏  举报