applicationContext.xml中的头部地址的意思
来源:互联网 发布:mysql select unique 编辑:程序博客网 时间:2024/06/05 08:17
不知道大家看到Spring配置文件头部的地址时候会不会疑问这些地址是做什么的,没有网的情况下,还会起到作用吗?如果的不了解的话,那么接着往下看:
首先拿一段大家熟悉的头部配置文件来看:
1.xmlns=http://www.springframework.org/schema/beans 和 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance 是必须有的所有的spring配置文件都一样
2.xmlns:xxx 这个是xml的命名空间,对于命名空间不进行展开,简单的理解其实就是你要使用spring的哪些模块的内容,之所以第一点说xmlns="http://www.springframework.org/schema/beans 是必须的,就是因为beans是spring的根本,如果连这个都没有的话就算不上是spring的配置文件了,在这个配置文件里面还有xmlns:p、 xmlns:mvc、xmlns:context 这三个命名空间,有了这些才可以使用<context:component /> <mvc:annotation-driven /> 这样的功能,如果没有这些命名空间的话而使用<context:component /> <mvc:annotation-driven /> 这些功能是会报错的哦!
3.下面就是xsi:schemaLocation了,这个是用来做什么的呢?其实是为上面配置的命名空间指定xsd规范文件,这样你在进行下面具体配置的时候就会根据这些xsd规范文件给出相应的提示,比如说每个标签是怎么写的,都有些什么属性是都可以智能提示的,以防配置中出错而不太容易排查,在启动服务的时候也会根据xsd规范对配置进行校验。
4.配置文件中.XSD文件的uri是http://www.springframework.org/schema/.............xsd 那么问题来了,真的要到网上去找这个.XSD文件吗?当然不是
打开spring-webmvc-4.2.3.RELEASE.jar>>META-INF>>spring.schemas 会看到以下内容:
http\://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd
http\://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd=org/springframework/web/servlet/config/spring-mvc-3.1.xsd
http\://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd=org/springframework/web/servlet/config/spring-mvc-3.2.xsd
http\://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd=org/springframework/web/servlet/config/spring-mvc-4.0.xsd
http\://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd=org/springframework/web/servlet/config/spring-mvc-4.1.xsd
http\://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd=org/springframework/web/servlet/config/spring-mvc-4.2.xsd
http\://www.springframework.org/schema/mvc/spring-mvc.xsd=org/springframework/web/servlet/config/spring-mvc-4.2.xsd
看到这些http://www.springframework.org/schema/.............xsd 内容大家就该明白了,其实http\://www.springframework.org/schema/mvc/spring-mvc.xsd 真正指向的位置是
org/springframework/web/servlet/config/spring-mvc-4.2.xsd,那么接着往下看,大声告诉我看到了啥?
终于看到xsd文件本尊就在这里啦。。。。。
- applicationContext.xml中的头部地址的意思
- applicationContext.xml中的使用${}是代表什么意思?
- Spring配置文件的applicationContext.xml文件头部出现红叉
- spring 的applicationContext.xml中的constructor-arg
- Spring的事务管理,applicationContext.xml中的配置
- struts.xml /applicationContext.xml、hiberante.xml头部文件文件查找
- spring的applicationContext.xml在web.xml中的配置详解
- spring配置文件头部配置解析(applicationContext.xml)
- ApplicationContext.xml的分析
- applicationContext.xml的配置文件
- applicationContext.xml的配置文件
- spring 的 applicationcontext.xml
- Spring的applicationContext.xml
- spring 的 applicationcontext.xml
- Spring的applicationContext.xml
- spring的applicationContext.xml
- applicationContext.xml的配置
- spring的applicationContext.xml
- 一些实用的JavaGUI技巧
- Linux学习(三):删除命令rm的注意事项
- USACO-section 1.3 Mixing Milk[贪心]
- 创建恢复目录+创建恢复目录步骤
- 第十五周算法题
- applicationContext.xml中的头部地址的意思
- 【Angular】——无限级下拉列表框
- Mac使用常识
- 深度学习概述:从感知机到深度网络
- QTP语句
- solr学习笔记 -- day06 模拟京东实现站内搜索
- python切割图片根据plist
- linux学习总结(四)
- 周志华《Machine Learning》学习笔记(13)--特征选择与稀疏学习