<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <!--开启注解-->
<context:annotation-config/>
<mvc:annotation-driven/>
<!--扫描包-->
<context:component-scan base-package="com.managerSystem.controller,com.managerSystem.service.impl"/>
<!--导入数据库包-->
<context:property-placeholder location="classpath:db.properties"/>
<!--加载连接池-->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="${mysql.driver}"/>
<property name="url" value="${mysql.url}"/>
<property name="username" value="${mysql.user}"/>
<property name="password" value="${mysql.password}"/>
</bean>
<!--整合mybatis-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="mapperLocations" value="classpath:mapper/*mapper-config.xml"/>
</bean>
<!--加载sqlSessionFactory-->
<bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
<property name="basePackage" value="com.managerSystem.dao"/>
</bean>
</beans>

2:mabatis映射文件相关:

XXXMapper.xml:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace=""> <select id="" resultType="" parameterType=""> </select>
</mapper>

SSM框架中spring的XML文件配置的更多相关文章

  1. SSM框架中的Mapper.xml文件中的增、删、改、查等操作

    <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "- ...

  2. ideal中spring的xml文件没有提示的问题

    ideal中spring的xml文件没有提示的问题 今天第一次用ideal来练习spring,发现和视频中老师不一样,我的没有提示.老师的视频里,他写了个<mvc:a   就会有一系列的提示,然 ...

  3. Spring框架入门之基于xml文件配置bean详解

    关于Spring中基于xml文件配置bean的详细总结(spring 4.1.0) 一.Spring中的依赖注入方式介绍 依赖注入有三种方式 属性注入 构造方法注入 工厂方法注入(很少使用,不推荐,本 ...

  4. tomcat中的server.xml文件配置了URIEncoding="UTF-8"需要注意的问题

    1.      get请求传递中文时本地连正式库访问都正常,正式环境下单独访问报错 代码: 请求:project/projectInfo/export/?cks=’项目类型 public String ...

  5. SSM搭配中的web.xml的配置信息

    最近一段时间在自己学着搭建SSM框架的项目,其实这个项目自由自己不断尝试,不断失败,才能印象更深刻. 下面就说一下在项目中的web.xml的相关配置信息: <?xml version=" ...

  6. Spring的xml文件配置方式实现AOP

    配置文件与注解方式的有很大不同,多了很多配置项. beans2.xml <?xml version="1.0" encoding="UTF-8"?> ...

  7. Spring(十二)使用Spring的xml文件配置方式实现AOP

    配置文件与注解方式的有非常大不同,多了非常多配置项. beans2.xml <?xml version="1.0" encoding="UTF-8"? & ...

  8. spring——通过xml文件配置IOC容器

    创建相关的类(这里是直接在之前类的基础上进行修改) package com.guan.dao; public interface Fruit { String getFruit(); } packag ...

  9. Spring 在xml文件中配置Bean

    Spring容器是一个大工厂,负责创建.管理所有的Bean. Spring容器支持2种格式的配置文件:xml文件.properties文件,最常用的是xml文件. Bean在xml文件中的配置 < ...

随机推荐

  1. 【转载】docker 应用之动态扩展容器空间大小

    docker 容器默认的空间是 10G, 如果想指定默认容器的大小(在启动容器的时候指定),可以在 docker 配置文件里通过 dm.basesize 参数指定,比如 docker -d --sto ...

  2. Nagios 使用 NSClient++ 监控Windows Server

    在被监控的Windows server 主机上安装NSClinet++下载地址:https://www.nsclient.org/download/32bit:http://files.nsclien ...

  3. 查看Ubuntu的显卡信息

    lspci -vnn|grep VGA -A 12 查看openGL信息: sudo apt install mesa-utils glxinfo|grep OpenGL -A 12

  4. NOIP2015斗地主(搜索+模拟+贪心)

    %%%Luan 题面就不说了,和斗地主一样,给一组牌,求最少打几次. 注意一点,数据随机,这样我们瞎搞一搞就可以过,虽然直接贪心可以证明是错的. 枚举方法,每次搜索按照(三顺子>二顺子>普 ...

  5. poj2431(优先队列+贪心)

    题目链接:http://poj.org/problem?id=2431 题目大意:一辆卡车,初始时,距离终点L,油量为P,在起点到终点途中有n个加油站,每个加油站油量有限,而卡车的油箱容量无限,卡车在 ...

  6. css预编译语言sass——mixin的使用

    以根据不同屏幕吃寸动态应用背景图片为例 新建一个mixin如下: @mixin bg_img($path, $ext){ @media screen and (max-device-width: 76 ...

  7. Mybatis 缓存失效的几种情况

    1 不在同一个sqlSession对象中 下面比较下载同一个sqlSession和不在同一sqlSession下面的两种情况: 同一sqlSession: @Test public final voi ...

  8. ELK日志系统安装、配置

    1.关闭SELINUX: [root@ELK /]# vim /etc/selinux/config 将SELINUX=enforcing修改为SELINUX=disabled 2.关闭防火墙: [r ...

  9. WebClient请求接口,get和post方法

    1,get方式 string URI = "url"; //实例化 WebClient client = new WebClient(); // client.UseDefault ...

  10. Django(十四)分页器(paginator)及自定义分页D

    http://www.mamicode.com/info-detail-1724597.html http://www.cnblogs.com/wupeiqi/articles/5246483.htm ...