ssmapplicationContent.xml

【ssmapplicationContent.xml】恢弘志士之气,不宜妄自菲薄。这篇文章主要讲述ssmapplicationContent.xml相关的知识,希望能为你提供帮助。

1 < ?xml version="1.0" encoding="UTF-8"?> 2 < beans xmlns="http://www.springframework.org/schema/beans" 3xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 4xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" 5xmlns:mvc="http://www.springframework.org/schema/mvc" 6xsi:schemaLocation=" 7http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 8http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd 9http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd 10http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 11http://www.springframework.org/schema/mvc 12http://www.springframework.org/schema/mvc/spring-mvc.xsd"> 13 14 15< mvc:annotation-driven /> 16< !-- 开启扫描,扫描所有的配置文件,以Controller注解的除外 --> 17< context:component-scan base-package="com.jlncrm"> 18< /context:component-scan> 19 20< !-- 以下是Spring MVC + Spring的全注解配置 --> 21 22< !-- Spring MVC 的所有配置 --> 23< bean 24class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" /> 25< bean 26class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter" /> 27 28< mvc:default-servlet-handler /> 29< !-- 静态资源处理 --> 30< mvc:resources mapping="/static/**" location="/WEB-INF/static/" /> 31 32< !-- 默认的视图解析器 在上边的解析错误时使用 (默认使用html)- --> 33< bean id="defaultViewResolver" 34class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 35< property name="viewClass" 36value="https://www.songbingjia.com/android/org.springframework.web.servlet.view.JstlView" /> 37< property name="contentType" value="https://www.songbingjia.com/android/text/html" /> 38< property name="prefix" value="https://www.songbingjia.com/WEB-INF/jsp/" /> 39< property name="suffix" value="https://www.songbingjia.com/android/.jsp" /> 40< /bean> 41 42< !-- 以下是Spring + Mybatis的全注解配置 --> 43 44< tx:annotation-driven transaction-manager="txManager" /> 45 46< !-- 注册事务管理 --> 47< bean id="txManager" 48class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> 49< property name="dataSource" ref="dataSource" /> 50< /bean> 51 52< !-- 定义dbcp数据源 --> 53< bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> 54< !-- 指定JDBC驱动类 --> 55< property name="driverClassName" value="https://www.songbingjia.com/android/com.mysql.jdbc.Driver"> 56< /property> 57< !-- 提供连接数据库的URL地址 --> 58< property name="url" value="https://www.songbingjia.com/android/jdbc:mysql://localhost:3306/crm"> 59< /property> 60< !-- 提供连接数据库的用户名和密码 --> 61< property name="username" value="https://www.songbingjia.com/android/root"> < /property> 62< property name="password" value="https://www.songbingjia.com/android/123456"> < /property> 63< /bean> 64 65< bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> 66< property name="dataSource" ref="dataSource" /> 67< property name="mapperLocations" value="https://www.songbingjia.com/android/classpath*:mapper/*Mapper.xml" /> 68< /bean> 69< bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> 70< property name="basePackage" value="https://www.songbingjia.com/android/com" /> 71< property name="annotationClass" value="https://www.songbingjia.com/android/org.springframework.stereotype.Repository"> < /property> 72< /bean> 73 74 < /beans>

 

    推荐阅读