<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"
xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.1.xsd">
  1. 首先说明最基本的头部命名空间信息,配置文件必须的部分,spring的根本
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

声明xml文件默认的命名空间,表示未使用其他命名空间的所有标签的默认命名空间。 
声明XML Schema 实例,声明后就可以使用 schemaLocation属性了。

xmlns:aop="http://www.springframework.org/schema/aop"

这是spring配置文件里面需要使用到aop的标签,声明前缀为aop的命名空间,后面的URL用于标示命名空间的地址不会被解析器用于查找信息。其惟一的作用是赋予命名空间一个惟一的名称。当命名空间被定义在元素的开始标签中时,所有带有相同前缀的子元素都会与同一个命名空间相关联。然后其他比如context(针对组件标签)、MVC(针对mvc标签)、tx(针对事务标签)都一样的意思。

xsi:schemaLaction部分:

http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd

是为上面配置的命名空间指定xsd规范文件,这样你在进行下面具体配置的时候就会根据这些xsd规范文件给出相应的提示,比如说每个标签是怎么写的,都有些什么属性是都可以智能提示的,以防配置中出错而不太容易排查,在启动服务的时候也会根据xsd规范对配置进行校验。 
注意:但是这里需要为你上面xmlns里面配置的mvc、aop、tx等都配置上xsd规范文件。

Spring 配置文件头部xmls解析的更多相关文章

  1. spring配置文件头部配置解析(applicationContext.xml)

    分享一个好的学习网站:http://how2j.cn?p=4509 相信大家对spring的配置文件应该都看的很多了,那么大家对配置文件头部的那一坨坨的东西到底是什么了解吗?下面我就把自己的一些见解和 ...

  2. spring配置文件头部配置解析

    http://blog.csdn.net/f_639584391/article/details/50167321

  3. spring配置文件头部xmlns配置精髓

    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w ...

  4. spring配置文件中util:properties和context:property-placeholder

    util:properties和context:property-placeholder标签都可以用来获取外部配置文件中的内容 1.util:properties 它是以声明bean方式来使用,创建了 ...

  5. 配置文件中取值: spring配置文件中util:properties和context:property-placeholder

    转载大神 https://blog.csdn.net/n447194252/article/details/77498916 util:properties和context:property-plac ...

  6. 关于spring配置文件中编辑时没有提示信息的问题

    spring配置文件头部信息主要是提供一个xml的编写规范作用. 新创建的配置文件引入头部信息后,编辑时没有提示信息,重启elipse即可解决.

  7. spring 配置文件的头部 xmls

    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w ...

  8. 系统启动时,spring配置文件解析失败,报”cvc-elt.1: 找不到元素 'beans' 的声明“异常

    现象:spring加载配置文件applicationContext.xml出错,抛出nested exception is og.xml.sax.SAXParseException; lineNumb ...

  9. SSH问题:系统启动时,spring配置文件解析失败,报”cvc-elt.1: 找不到元素 'beans' 的声明“异常

    现象:spring加载配置文件applicationContext.xml出错,抛出nested exception is og.xml.sax.SAXParseException; lineNumb ...

随机推荐

  1. Maven项目:Plugin execution not covered by lifecycle configuration 解决方案

    这个是eclipse中配置文件pom.xml报的错.具体错误信息: Plugin execution not covered by lifecycle configuration: org.apach ...

  2. 初入AngularJS

    AngularJS是一款优秀的前端JS框架,已经被用于Google的多款产品当中.AngularJS有着诸多特性,最为核心的是:MVVM.模块化.自动化双向数据绑定.语义化标签.依赖注入等等. Ang ...

  3. vue 父子组件传值:props和$emit

    <!--子组件页面--> <template> <div class="hello"> <!-- 添加一个input输入框 添加keypr ...

  4. CodeForcesEducationalRound40-D Fight Against Traffic 最短路

    题目链接:http://codeforces.com/contest/954/problem/D 题意 给出n个顶点,m条边,一个起点编号s,一个终点编号t 现准备在这n个顶点中多加一条边,使得st之 ...

  5. qduoj~前端~二次开发

    青岛大学qdu的onlinejudge是js的写的前端,框架是vue.js,在nodejs上部署运行,其实整体运行还是建立在docker的容器虚拟环境里,这里暂时不需要docker.安装环境是Ubun ...

  6. 题解 CF915D 【Almost Acyclic Graph】

    这道题我第一次的想法是直接判环的数量,然而事实证明实在是太naive了. 随便画个图都可以卡掉我的解法.(不知道在想什么) 这道题的正解是拓扑排序. 朴素的想法是对所有边都跑一次拓扑,但这样$O(m( ...

  7. 题解 P2330 【[SCOI2005]繁忙的都市】

    又是一道Kruskal题目. AC代码见下. 主要思路就是将所有的边储存起来,然后进行贪心地选择,期间需要判断两个端点是否有关联,这一过程通过并查集实现.Kruskal部分套模板就可以了. #incl ...

  8. CSU 1249 竞争性酶抑制剂和同工酶

    1249: 竞争性酶抑制剂和同工酶 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 109  Solved: 49 Description 人体内很多化学 ...

  9. 钩子(hooks)—webhook-使用钩子自动触发部署

    钩子(hooks)-webhook http://fighter.blog.51cto.com/1318618/1670667 https://www.lovelucy.info/auto-deplo ...

  10. 二、 HBase核心功能模块。

      Hadoop 框架包含两个核心组件: HDFS 和 MapReduce 其中     HDFS                是文件存储系统,负责数据存储:     MapReduce     是 ...