gpt4 book ai didi

java - web.xml : "No grammar constraints (DTD or XML schema) detected for the document." 的虚假 Eclipse 警告

转载 作者:IT老高 更新时间:2023-10-28 20:54:50 26 4
gpt4 key购买 nike

我的 web.xml 文件的顶部如下所示:

<?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 配置文件)没有警告,但确实给出了有关架构违规的正确警告。

如何使架构检查正常工作并希望警告消失?服务器运行正常。这似乎是一个 IDE 问题。

最佳答案

我也讨厌这个警告。特别是因为它出现在您尚未编写的 XML 文件中,但出于任何原因出现在您的项目中(如果您使用 MAVEN,那就太糟糕了)。

使用 Eclipse 3.5+,您可以轻松删除此验证规则。转到 Preferences-->XML-->XML FILES --> Validation 并选择“ignore”。

您可能还需要执行一个项目 -> 清理才能消除验证警告。

alt text

关于java - web.xml : "No grammar constraints (DTD or XML schema) detected for the document." 的虚假 Eclipse 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/322155/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com