阅读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和注解的两种形式