問(wèn)題描述
我的 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">
但我仍然收到來(lái)自 Eclipse (Ganymede) 的警告,即未檢測(cè)到 XML 模式,并且沒(méi)有警告模式違規(guī).我項(xiàng)目中的其他 XML 文件(例如 Spring Framework 配置文件)沒(méi)有警告,并且確實(shí)給出有關(guān)架構(gòu)違規(guī)的正確警告.
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.
如何使架構(gòu)檢查正常工作并希望警告消失?服務(wù)器運(yùn)行正常.這似乎是一個(gè) IDE 問(wèn)題.
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
<小時(shí)>
另外,<!DOCTYPE ...>
也不見(jiàn)了:
<?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>
這篇關(guān)于web.xml 的虛假 Eclipse 警告:“未檢測(cè)到文檔的語(yǔ)法約束(DTD 或 XML 模式)."的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!