use*_*206 14 java spring javabeans
当我创建一个弹簧项目时,我总是遇到XLMNS的问题.什么是XMLNS?实际上这些是什么?
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"
Run Code Online (Sandbox Code Playgroud)
我在哪里可以获得这些参考?(xmlns的资源:xsi和xsi:schemeLocation.)是否有这些在线手册?我似乎无法找到它们.
注意 当我说引用时,我指的是适合它们的URL
更新
我在哪里可以看到Spring bean,Spring Transactions,Spring MVC等的XML命名空间?及其架构位置?
Sol*_*ris 17
这里有一个很好的解释: xsi:schemaLocation的用途是什么?
这是xsd config上的spring docs:http: //static.springsource.org/spring/docs/current/spring-framework-reference/html/xsd-config.html
注意:spring现在建议不要在xsd中包含版本号,除非特别要求,所以你应该:
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd"
Run Code Online (Sandbox Code Playgroud)
而不是:
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
Run Code Online (Sandbox Code Playgroud)
"xmlns"定义当前元素的名称空间.
"xmlns:aop"定义当前元素中元素的名称空间,前缀为"aop:"