歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Spring中編寫配置文件之幫助提示

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

日期:2017/3/1 10:10:41   编辑:Linux編程
先來看一個spring基本配置文件的文件頭

<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-2.5.xsd">

起到提示作用的是http://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改為http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

Copyright © Linux教程網 All Rights Reserved