Bogus Eclipse warning for web.xml: quot;No grammar constraints (DTD or XML schema) detected for the document.quot;(web.xml 的虚假 Eclipse 警告:“未检测到文档的语法约束(DTD 或 XML 模式).)
问题描述
我的 web.xml 文件的顶部如下所示:
The top of my web.xml file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app 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_5.xsd"
version="2.5">
但我仍然收到来自 Eclipse (Ganymede) 的警告,即未检测到 XML 模式,并且没有警告模式违规.我项目中的其他 XML 文件(例如 Spring Framework 配置文件)没有警告,并且确实给出有关架构违规的正确警告.
But I still get the warning from Eclipse (Ganymede) that no XML schema is detected, and schema violations are not being warned about. Other XML files in my project (Spring Framework configuration files for example) don't have the warning and do give correct warnings about schema violations.
如何使架构检查正常工作并希望警告消失?服务器运行正常.这似乎是一个 IDE 问题.
How do I get the schema checking working and hopefully the warning to go away? The server does run correctly. It just appears to be an IDE issue.
推荐答案
或许可以试试:
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
代替:
http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd
<小时>
另外,<!DOCTYPE ...> 也不见了:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xml>
<web-app
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/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<!-- ... -->
</web-app>
这篇关于web.xml 的虚假 Eclipse 警告:“未检测到文档的语法约束(DTD 或 XML 模式)."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:web.xml 的虚假 Eclipse 警告:“未检测到文档的语法
基础教程推荐
- RabbitMQ:消息保持“未确认"; 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 如何对 Java Hashmap 中的值求和 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
