解决web-app_2_4.xsd验证web.xml时报j2ee_web_services_client_1_1.xsd找不到的问题
2007-06-07 19:03
537 查看
解决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
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
要在网上读取验证文件 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 ,即如下:
代码
<xsd:include schemaLocation="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"/>
但是要下载却下载不了,于是上Sun Java去。。。
在 http://java.sun.com/xml/ns/j2ee/ 中有,显示的仍是ibm的,但链接是sun的,可以直接下载下来的
于是索性在 j2ee_1_4.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
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
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
要在网上读取验证文件 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 ,即如下:
代码
<xsd:include schemaLocation="http://www.ibm.com/webservices/xsd/j2ee_web_services_client_1_1.xsd"/>
但是要下载却下载不了,于是上Sun Java去。。。
在 http://java.sun.com/xml/ns/j2ee/ 中有,显示的仍是ibm的,但链接是sun的,可以直接下载下来的
于是索性在 j2ee_1_4.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
相关文章推荐
- The content of element type "web-app" must match……问题之解决办法
- FacesServlet (Java EEWTP/JSF问题的解决--java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
- Attribute "xmlns" was already specified for element "web-app".问题的解决
- The content of element type "web-app" must match……问题之解决办法
- ftpClient类问题解决两则:方法找不到和listFiles方法返回个数为零
- ] 解决myeclipse中新建javaweb工程,无法使用Web App Libraries问题
- 解决idea自动生成的web.xml中web-app报错的问题
- SQL Server Reporting Services 用户不具有所需的权限。请验证授予了足够的权限并且解决了 Windows 用户帐户控制(UAC)限制问题。
- 解决eclipse svn 转 maven web 项目中遇到找不到maven managed dependencies的问题
- The content of element type "web-app" must match……问题之解决办法
- 解决: httpclient ssl 验证导致死锁问题
- C++问题-UniqueAppObject.cpp(147): error C3861: “GUXClientInit”: 找不到标识符
- validationGroup和Page_ClientValidate()配合使用解决前端click事件返回为false时验证失效问题
- C# webclient中文乱码问题解决方法
- WTP/JSF问题的解决--java.lang.ClassNotFoundException: javax.faces.webapp.FacesServlet
- 关于Cannot construct org.apache.maven.plugin.war.util.WebappStructure maven打包问题解决
- maven fastdfs_client.jar找不到问题解决
- eclipse部署web项目在本地tomcat下的webappps里找不到解决方法
- 解决Eclipse环境变量中的Web App Libraries下没有jar包的问题
- 通过Page_ClientValidate解决验证控件和confirm冲突的问题