<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. POJ 1274 二分图匹配

    匈牙利算法 裸题 //By SiriusRen #include <cstdio> #include <cstring> #include <algorithm> ...

  2. 使用JSON Web Token设计单点登录系统--转

    原文地址:https://leon_lizi.gitbooks.io/json-web-token/content/chapter2.html 用户认证八步走 所谓用户认证(Authenticatio ...

  3. Android框架-Volley(四)

    经过前三篇文章的学习,Volley的用法我们已经掌握的差不多了,但是对于Volley的工作原理,恐怕有很多朋友还不是很清楚.因此,本篇文章中我们就来一起阅读一下Volley的源码,将它的工作流程整体地 ...

  4. 上传golang 版本SDK

    在上传的时候,文件都上传成功了,但是返回的信息里面errcode 404 token 是"".是不是因为我的callbackUrl(随便写的) 写错导致的. 上传golang 版本 ...

  5. vue2.0 兄弟组件数据传递方法

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. Chrome插件开发笔记

    使用 XMLHttpRequest来抓取盗版小说网站里面的内容,但是注意需要在manifest.json文件中设置permission var xhr = new XMLHttpRequest();x ...

  7. 阿里云安装mysql数据库出现2002错误解决办法

    在安装数据库的时候出现了如下错误: 解决办法如下: 1.在bin目录下 输入:kill -s 9 9907 再输入:ps -ef|grep mysql 显示如下: 2.回到lampp目录下,重启数据库 ...

  8. vscode 调试vue.js程序

    npm install -g vue-cli                //安装vue-clivue init webpack projectName  //创建项目 1.Ctrl+~ 打开命令行 ...

  9. HDU-1789 Doing Homework again 贪心问题 有时间限制的最小化惩罚问题

    题目链接:https://cn.vjudge.net/problem/HDU-1789 题意 小明有一大堆作业没写,且做一个作业就要花一天时间 给出所有作业的时间限制,和不写作业后要扣的分数 问如何安 ...

  10. SweetAlert的入门

    在做后台管理系统,在用户交互这块(弹窗.提示相关),用了一款还不错的插件SweetAlert(一款原生js提示框,允许自定义,支持设置提示框标题.提示类型.确认取消按钮文本.点击后回调函数等等), 效 ...