Spring配置文件: applicationContext.xml

applicationContext.xml是Spring的核心配置文件

IOC/DI,AOP相关配置都是在这个文件中

SpringMVC配置文件: springmvc-servlet.xml

视图定位,资源访问相关配置,servlet业务相关

Mybatis配置文件:mybatis-config.xml

其作用主要是提供连接数据库用的驱动,数据库名称,编码方式,账号密码

SSM配置文件:applicationContext.xml, springMVC.xml

applicationContext.xml是Spring的核心配置文件

个人理解:下面2,3,4条是将Mybatis的配置文件mybatis-config.xml纳入其管理之下

其作用

  1. 通过注解,将Service的生命周期纳入Spring的管理
<context:annotation-config />
<context:component-scan base-package="com.how2java.service" />
  1. 配置数据源
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  1. 扫描存放SQL语句的Category.xml
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean">
  1. 扫描Mapper,并将其生命周期纳入Spring的管理
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">

springMVC.xml

  1. 扫描Controller,并将其生命周期纳入Spring管理
    <context:annotation-config/>
<context:component-scan base-package="com.how2java.controller">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Controller"/>
</context:component-scan>
  1. 注解驱动,以使得访问路径与方法的匹配可以通过注解配置
<mvc:annotation-driven />
  1. 静态页面,如html,css,js,images可以访问
<mvc:default-servlet-handler />
  1. 视图定位到/WEB/INF/jsp 这个目录下
<bean  class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>

Spring,SpringMVC,MyBatis,SSM配置文件比较的更多相关文章

  1. Spring+SpringMVC+Mybatis(SSM)框架集成搭建

    Spring+SpringMVC+Mybatis框架集成搭建教程 一.背景 最近有很多同学由于没有过SSM(Spring+SpringMvc+Mybatis , 以下简称SSM)框架的搭建的经历,所以 ...

  2. spring+springmvc+mybatis xml配置文件

    一.jdbc.properties 文件: driver=com.mysql.jdbc.Driverurl=jdbc:mysql://192.168.31.xxx:3306/abc?useUnicod ...

  3. spring+springmvc+mybatis(ssm)

    1.jdbc.properties jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/jk ...

  4. SSM 框架-06-详细整合教程(IDEA版)(Spring+SpringMVC+MyBatis)

    SSM 框架-06-详细整合教程(IDEA版)(Spring+SpringMVC+MyBatis) SSM(Spring.Spring MVC和Mybatis)如果你使用的是 Eclipse,请查看: ...

  5. SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释(转)

    原文:https://blog.csdn.net/yijiemamin/article/details/51156189# 这几天一直在整合SSM框架,虽然网上有很多已经整合好的,但是对于里面的配置文 ...

  6. 0927-转载:SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释

    这篇文章暂时只对框架中所要用到的配置文件进行解释说明,而且是针对注解形式的,框架运转的具体流程过两天再进行总结. spring+springmvc+mybatis框架中用到了三个XML配置文件:web ...

  7. SSM:spring+springmvc+mybatis框架中的XML配置文件功能详细解释

    这几天一直在整合SSM框架,虽然网上有很多已经整合好的,但是对于里面的配置文件并没有进行过多的说明,很多人知其然不知其所以然,经过几天的搜索和整理,今天总算对其中的XML配置文件有了一定的了解,所以拿 ...

  8. SSM三大框架整合详细教程(Spring+SpringMVC+MyBatis)【转】

    使用SSM(Spring.SpringMVC和Mybatis)已经有三个多月了,项目在技术上已经没有什么难点了,基于现有的技术就可以实现想要的功能,当然肯定有很多可以改进的地方.之前没有记录SSM整合 ...

  9. SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)

    1.前言 使用框架都是较新的版本: Spring 4.0.2 RELEASE Spring MVC 4.0.2 RELEASE MyBatis 3.2.6 2.Maven引入需要的JAR包 2.1设置 ...

  10. [JSP]Maven+SSM框架(Spring+SpringMVC+MyBatis) - Hello World

    来源:http://blog.csdn.net/zhshulin/article/details/37956105?utm_source=tuicool&utm_medium=referral ...

随机推荐

  1. [SDOI2019]世界地图(kruskal重构树+虚树)

    通过子任务1.3十分显然,子任务4实际上就是线段树,和我下午写的[SDOI2015]道路修建一模一样,堪称“我抄我自己”,不会的可以先做一下这个题. 然后考虑正解,参考了zhoushuyu的博客,首先 ...

  2. 6.Redis集群

    redis-cluster[集群]架构图 redis-cluster投票:容错 搭建Ruby环境 集群的搭建过程 连接集群 查看集群的命令 1.1 redis-cluster[集群]架构图 架构细节: ...

  3. 修改mysql密码报错: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '

    使用这种格式报错: 格式:mysql> set password for 用户名@localhost = password('新密码'); 找到另一种方法解决: ALTER USER 'root ...

  4. G - Green-Red Tree Gym - 102190G

    题目链接:http://codeforces.com/gym/102190/attachments 题解:我们先将前5个点分别涂上红色或者绿色,使得这两棵树在5个点中都是连通,并不存在自环(建边方式不 ...

  5. Python练习五-函数

    1.简述普通参数.指定参数.默认参数.动态参数的区别1)普通参数中,有形参和实参,其中形参是定义函数时写的参数,实参是调用函数时传给函数的参数:2)默认参数是在定义函数时,参数设定一个默认值:3)指定 ...

  6. mysql在当前服务器复制数据库

    mysqldump newwq -u root -proot --add-drop-table | mysql jxg -u root -proot

  7. spring注入原型bean

    <bean id="httpClient" class="org.apache.commons.httpclient.HttpClient" scope= ...

  8. 用dfs序处理线段树的好题吗?

    https://www.cnblogs.com/mountaink/p/9878918.html 分析:每次的选取必须选最优的一条链,那我们考虑一下选择这条链后,把这条路上的点的权值更新掉,再采取选最 ...

  9. [Windows] Access SMBIOS

    SMBIOS architecture System Management BIOS (SMBIOS) is the premier standard for delivering managemen ...

  10. 前端-jQuery-长期维护

     ###############    jQuery简介     ################ jQuery这是非常重要的,在django项目中大量的前端都是使用jQuery进行操作 为什么要学习 ...