Spring的設定檔ApplicationContext.xml配置標頭檔解析

來源:互聯網
上載者:User

標籤:statistic   紅色   clear   需要   b2c   lin   content   分享圖片   encoding   

Spring的設定檔ApplicationContext.xml配置標頭檔解析原創 2016年12月16日 14:22:43
  • 標籤:
  • spring設定檔
  • 5446
spring中的applicationContext.xml配置標頭檔解析<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns:tx="http://www.springframework.org/schema/tx"     xmlns:aop="http://www.springframework.org/schema/aop"     xmlns:context="http://www.springframework.org/schema/context"     xsi:schemaLocation="     http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans-4.1.xsd     http://www.springframework.org/schema/context     http://www.springframework.org/schema/context/spring-context-4.1.xsd     http://www.springframework.org/schema/tx     http://www.springframework.org/schema/tx/spring-tx-4.1.xsd     http://www.springframework.org/schema/aop     http://www.springframework.org/schema/aop/spring-aop-4.1.xsd     "></beans>首先要做的是匯入相關jar包,這裡一aop為例所以只說匯入了aop相關的jar包這四個jar包是必不可少的。jar包:http://pan.baidu.com/s/1nvTPNRV

配置標頭檔所引用的檔案包(版本號碼要匹配上)

步驟(1)、下載spring-framework-4.1.6

(2)、eclipse中點擊window-preferances,在彈出框中輸入xml catalog,看到如下介面

 

點擊add

從檔案選擇其中找到你所下載的spring-framework-4.16開啟檔案夾,然後開啟schema檔案夾該目錄下就是你所要引入的相關標籤的檔案夾下面以aop標籤為例,其他標籤都是同樣的操作步驟。(1)、開啟aop檔案夾。然後選中spring-aop-4.1.xsd,點擊打卡 在這裡需要特別注意的是location: F:\JavaIntegration\spring-framework-4.1.6.RELEASE-dist\spring-framework-4.1.6.RELEASE\schema\aop\spring-aop-4.1.xsd中的綠色背景的文字是與圖中綠色框中的一樣的,也就是版本一定要對應上,而紅色框中的值就是中key的值。在這裡特別說明的原因是有時我們會從網上複製標頭檔不知道其中的原理這樣就會出現版本不對應的錯誤

 注意!!!首先要保證 http://www.springframework.org/schema/beans/spring-beans.xsd 的約束檔案Schema location要配置得有,不然其他的Schema location即使配置了也不會出來!!! 其次:key:的xsd檔案最好不要寫版本號碼

 到此aop的標頭檔就配置完了,其他標頭檔標籤配置與此類似。

Spring的設定檔ApplicationContext.xml配置標頭檔解析

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.