平常用到spring时把它的配置文件copy过来就是了,但是最近看看里面的一些代码,有的还不是太明白,请高手们指导指导。
xmlns=" http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=" http://www.springframework.org/schema/context"
xmlns:aop=" http://www.springframework.org/schema/aop"
xmlns:tx=" http://www.springframework.org/schema/tx"
xmlns:mvc=" http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"
命名空间到底产生什么作用呢? 后面的schema是不是电脑不联网就不受约束了?还是这些文件已经存在eclipse的某个文件夹里了?因为点击ctrl和左键时能够看到文件内容。 还有配置xml catalog时的具体选项是什么样的呢?是选public id还是Url呢?
spring
xmlns=" http://www.springframework.org/schema/beans"
xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=" http://www.springframework.org/schema/context"
xmlns:aop=" http://www.springframework.org/schema/aop"
xmlns:tx=" http://www.springframework.org/schema/tx"
xmlns:mvc=" http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"
命名空间到底产生什么作用呢? 后面的schema是不是电脑不联网就不受约束了?还是这些文件已经存在eclipse的某个文件夹里了?因为点击ctrl和左键时能够看到文件内容。 还有配置xml catalog时的具体选项是什么样的呢?是选public id还是Url呢?
spring
这个schema就是约束这些标签的使用规范,相当于jsp标签库上的uri。在配置public id的时候id只是在IDE工具里的一个标识,具体的还是uri路径即schema文档路径,所以public id是不可重复的,uri则可以。
http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/extensible-xml.html#extensible-xml-registration