Spring 配置文件头部xmls解析
<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">
- 首先说明最基本的头部命名空间信息,配置文件必须的部分,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解析的更多相关文章
- spring配置文件头部配置解析(applicationContext.xml)
分享一个好的学习网站:http://how2j.cn?p=4509 相信大家对spring的配置文件应该都看的很多了,那么大家对配置文件头部的那一坨坨的东西到底是什么了解吗?下面我就把自己的一些见解和 ...
- spring配置文件头部配置解析
http://blog.csdn.net/f_639584391/article/details/50167321
- spring配置文件头部xmlns配置精髓
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w ...
- spring配置文件中util:properties和context:property-placeholder
util:properties和context:property-placeholder标签都可以用来获取外部配置文件中的内容 1.util:properties 它是以声明bean方式来使用,创建了 ...
- 配置文件中取值: spring配置文件中util:properties和context:property-placeholder
转载大神 https://blog.csdn.net/n447194252/article/details/77498916 util:properties和context:property-plac ...
- 关于spring配置文件中编辑时没有提示信息的问题
spring配置文件头部信息主要是提供一个xml的编写规范作用. 新创建的配置文件引入头部信息后,编辑时没有提示信息,重启elipse即可解决.
- spring 配置文件的头部 xmls
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w ...
- 系统启动时,spring配置文件解析失败,报”cvc-elt.1: 找不到元素 'beans' 的声明“异常
现象:spring加载配置文件applicationContext.xml出错,抛出nested exception is og.xml.sax.SAXParseException; lineNumb ...
- SSH问题:系统启动时,spring配置文件解析失败,报”cvc-elt.1: 找不到元素 'beans' 的声明“异常
现象:spring加载配置文件applicationContext.xml出错,抛出nested exception is og.xml.sax.SAXParseException; lineNumb ...
随机推荐
- ListView的setOnItemClickListener回调不能执行的解决
如果ListView中的单个Item的view中存在checkbox,button等view,会导致ListView.setOnItemClickListener无效,事件会被子View捕获到,Lis ...
- Servlet监听器及在线用户
Servlet中的监听器分为三种类型Ⅰ 监听ServletContext.Request.Session作用域的创建和销毁 (1)ServletContextListener (2)HttpSessi ...
- JavaScript,ES5和ES6的区别
什么是JavaScript JavaScript一种动态类型.弱类型.基于原型的客户端脚本语言,用来给HTML网页增加动态功能.(好吧,概念什么最讨厌了) 动态: 在运行时确定数据类型.变量使用之前不 ...
- js对浏览器产生的影响
Js 是单线程执行引擎.在我们动态修改一些属性时会产生两种效果: 1.Repaint ----- 一部分重画,修改 div 的颜色呀,但是尺寸没有改变. 2.Reflow ---- 元素 ...
- NodeJS学习笔记 (30)定时器-timers
https://github.com/chyingp/nodejs-learning-guide
- c3p0-config.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xml> <c3p0-confi ...
- ES6学习笔记(十三)Iterator遍历器和for...of循环
1.概念 遍历器(Iterator)就是这样一种机制.它是一种接口,为各种不同的数据结构提供统一的访问机制.任何数据结构只要部署 Iterator 接口,就可以完成遍历操作(即依次处理该数据结构的所有 ...
- HDU-1225 Football Score 模拟问题(水题)
题目链接:https://cn.vjudge.net/problem/HDU-1225 水题 代码 #include <algorithm> #include <string> ...
- 端口扫描软件Nmap使用一(下载于安装)
端口扫描软件Nmap使用一(下载于安装) Nmap的下载地址虽然很多,但是对于新手来说,尽量在官方网址下载,某些第三方下载网址很不人道,使用他们加速器的时候会绑定下载很多垃圾软件,会给我们造成很多不必 ...
- 【Loadrunner】Vugen录制脚本为空的解决办法
1. ie -> 工具 -> Internet选项 - 高级 - 勾除“启动第三方浏览器扩展选项”,然后重启电脑 2. 还有一种可能,就是机器上安装了多个浏览器,从而导致出现问题,解决方法 ...