閱讀55 返回首頁    go 阿裏雲 go 技術社區[雲棲]


Spring中編寫配置文件之幫助提示


先來看一個spring基本配置文件的文件頭

 

<beans xmlns="https://www.springframework.org/schema/beans"
       xmlns:xsi="
https://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
https://www.springframework.org/schema/beans
           https://www.springframework.org/schema/beans/spring-beans-2.5.xsd">


起到提示作用的是https://www.springframework.org/schema/beans/spring-beans-2.5.xsd

myeclipse會從網上下載該xsd,將該文件內容緩存


在編寫spring.xml出現提示有如下方法


方法一

打開網絡,讓eclipse自行上網下載

 

方法二

手動添加schema文件


① 找到xmlcatalog

windows—>preferences—>myeclipse—>files and editors—>xml—>xmlcatalog

 

②找到xds文件

點擊add在出現的窗口中的Key Type中選擇URI,在location中選擇"File system",找到spring解壓目錄的dis/resource目錄中選擇spring-beans-2.5.xsd

 

③配置相關信息

將Key Type改為Schema location。Key改為https://www.springframework.org/schema/beans/spring-beans-2.5.xsd

 

 

最後更新:2017-04-02 15:28:22

  上一篇:go Spring中注入基本類型
  下一篇:go Spring中bean的初始化和銷毀之前的方法XML和注解的兩種形式