【发布时间】:2021-12-31 18:52:02
【问题描述】:
嘿,我正在使用 jdk 11 在 Eclipse 中创建一个新的动态 Web 项目。问题是它给了我关于我的 web-app 属性的错误,顺便说一句,我尝试使用版本 2.4 和 3.0,但两者都有相同的错误。
我的代码:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
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_3_0.xsd" version="3.0">
<display-name>Lasb5Exercise</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
第2个错误涉及:
- cvc-attribute.3:元素“web-app”上属性“version”的值“2.5”相对于其类型“web-app-versionType”无效。
- cvc-enumeration-valid:值 '2.5' 对于枚举 '[2.4]' 不是 facet-valid。它必须是来自枚举的值。
帮我解决这个问题!!! T.T 提前致谢。
【问题讨论】:
标签: xml eclipse jakarta-ee