解决web-app_2_4.xsd验证web.xml时报j2ee_web_services_client_1_1.xsd找不到的问题
web.xml
代码
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
代码
<xsd:include schemaLocation="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"/>
代码
<!-- <xsd:include schemaLocation="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"/> -->
<xsd:include schemaLocation="j2ee_web_services_client_1_1.xsd"/>
2、在 <XMLSpy_HOME>/MainCatalog.xml 文件中增加如下内容并保存
代码
<!-- web-app 2.4 Section -->
<uri name="http://java.sun.com/xml/ns/j2ee" uri="schemas/java/web-app_2_4.xsd"/>
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