编写Spring框架的配置文件时,标签无提示的解决办法

原文地址:http://blog.****.net/yerenyuan_pku/article/details/52831618

myeclipse中的地方,其它同下方

编写Spring框架的配置文件时,标签无提示的解决办法

问题描述

初学者在学习Spring框架的过程中,大概会碰到这样一个问题:在编写Spring框架的配置文件时,标签无提示符。本文就来解决掉这种问题。

问题原因

由于Spring的schema文件位于网络上,如果机器不能连接到网络,那么在编写配置信息时候就无法出现提示信息。

解决方案

手动添加schema文件,方法如下:

  1. Windows→Preferences
  2. XML→XML Catalog→User Specified Entries→Add
  3. 点击”add”,在出现的窗口中的Key type中选择URI,在Location中选”File System”。

4.  然后在spring解压目录的schema/beans目录中选择spring-beans-4.2.xsd。

  1. 回到设置窗口的时候不要急着关闭窗口,应把窗口中的Key type改为Schema location,Key改为http://www.springframework.org/schema/beans/spring-beans-4.2.xsd

    点击ok就可以了。

总结

我们在学习其他框架,比如hibernate、spring、Spring MVC等等框架时,如果碰到编写该框架的配置文件时,标签无提示符,同样可以这样做哟!