spring配置文件beans的xmlns都有什么含義?


<beans 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:mvc="http://www.springframework.org/schema/mvc"
 xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.1.xsd
 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.1.1.xsd">

(spring.3.1.1)

因為xml文檔都有格式,為了spring的配置文件增加的節點能滿足要求、合法,所以引入校驗該xml的格式文件。

xmlns是xml命名空間的意思,而xmlns:xsi是指xml所遵守的標簽規范。

1.xmlns:關於初始化bean的格式文件地址

2.xmlns:xsi:輔助初始化bean

3.xsi:context:關於spring上下文,包括加載資源文件

4.xsi:schemaLocation:用於聲明了目標名稱空間的模式文檔


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM