读书人

web-app_2_4.xsd印证web.xml报j2ee_we

发布时间: 2012-10-27 10:42:26 作者: rapoo

web-app_2_4.xsd验证web.xml报j2ee_web_services_client_1_1.xsd找不到
web-app_2_4.xsd验证web.xml时报j2ee_web_services_client_1_1.xsd找不到的问题

web.xml


要在网上读取验证文件 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd 来验证web.xml文件格式的正确性,导致速度变慢。
该验证在修改xml文件后,每次保存文件时都要进行执行的。

一、XMLSpy中的解决办法
1、下载以下所有的验证文件到本地,比如放:<XMLSpy_HOME>\Schemas\java目录下
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd
http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd
http://java.sun.com/xml/ns/j2ee/j2ee_web_services_client_1_1.xsd
注意: j2ee_1_4.xsd 中却包含了 Web services schema ,即如下:


3、重启XMLSpy,打开web.xml,然后按F8吧,绿色的打色出现了吧。

二、Eclipse中的解决办法
1、同上下载所有的验证文件到本地。。。

2、Windows ==> Preferences ==> Web and XML ==> XML Catalog,然后右边窗口点击 add 按钮,打开 Add XML Catalog Entry 窗口。URI选择框选择到 web-app_2.4.xsd 文件 ,确定后,Key Type 会自动选中 Namespace Name ,Key会自动填入: http://java.sun.com/xml/ns/j2ee ,OK 确定即可。

3、重新打开web.xml

读书人网 >Web前端

热点推荐