Spring head

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

	<bean id="clientInvoke" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
		<property name="serviceUrl" value="rmi://localhost:1112/CypherService" />
		<property name="serviceInterface" value="edu.gmit.rmi.CypherService" />
	</bean>

</beans>

 

beans —— xml文件的根節點

 

xmlns ——是XML NameSpace的縮寫,因爲XML文件的標籤名稱都是自定義的,自己寫的和其他人定義的標籤很有可能會重複命名,而功能卻不一樣,所以需要加上一個namespace來區分這個xml文件和其他的xml文件,類似於java中的package。

 

xmlns:xsi ——是指xml文件遵守xml規範,xsi全名:xml schema instance,是指具體用到的schema資源文件裏定義的元素所準守的規範。即/spring-beans-2.0.xsd這個文件裏定義的元素遵守什麼標準

 

xsi:schemaLocation——是指,本文檔裏的xml元素所遵守的規範

 
發佈了211 篇原創文章 · 獲贊 1 · 訪問量 1萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章