Spring 配置文件头部xmls解析
来源:互联网 发布:金蝶软件服务商 编辑:程序博客网 时间:2024/06/06 05:51
<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/beanshttp://www.springframework.org/schema/beans/spring-beans-3.1.xsd
是为上面配置的命名空间指定xsd规范文件,这样你在进行下面具体配置的时候就会根据这些xsd规范文件给出相应的提示,比如说每个标签是怎么写的,都有些什么属性是都可以智能提示的,以防配置中出错而不太容易排查,在启动服务的时候也会根据xsd规范对配置进行校验。
注意:但是这里需要为你上面xmlns里面配置的mvc、aop、tx等都配置上xsd规范文件。
阅读全文
0 0
- Spring 配置文件头部xmls解析
- spring配置文件头部配置解析
- spring配置文件头部配置解析
- spring配置文件头部配置解析(applicationContext.xml)
- [Spring] Spring配置文件头部xmlns配置
- spring配置文件头部xmlns配置解说
- Spring配置文件XML头部文件模板
- spring配置文件头部xmlns配置 详细解释
- Spring配置文件的头部的一些解释
- 典型的spring xml配置文件头部
- Spring的XML配置文件的头部文件
- spring配置文件头部xmlns配置解说
- Spring配置文件beans.xml头部配置解释
- 在java中使用dom4j解析xmls的简单例子
- Spring配置文件解析-Bean
- spring --MethodInvokingFactoryBean 配置文件解析
- spring mvc配置文件解析
- spring配置文件解析
- 网络编程(一)
- HDU1021
- Lock和synchronized的区别和使用
- 模板方法模式
- 如何从零设计结构清晰、操作友好的权限管理模块
- Spring 配置文件头部xmls解析
- android侧滑菜单
- [LeetCode] 26.Remove Duplicates from Sorted Array
- java设计模式之责任
- 学习记录5
- 最短路径详解
- 网络编程(二)
- mysql记录慢查询日志的方法
- 安卓LOG封装类