Servlets web.xml验证错误
web xml中还有一个错误 -无法将名称“javaee:web appType”解析为(n)“类型定义”组件 和web.xml文件Servlets web.xml验证错误,servlets,jakarta-ee,web.xml,Servlets,Jakarta Ee,Web.xml,web xml中还有一个错误 -无法将名称“javaee:web appType”解析为(n)“类型定义”组件 和web.xml文件 <?xml version="1.0" encoding="UTF-8"?><!--error here--> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sch
<?xml version="1.0" encoding="UTF-8"?><!--error here-->
<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"
您忘记了xmlns:web
名称空间。下面是完整的Servlet3.0兼容声明
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
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"
id="Your_Webapp_ID" version="3.0">
<!-- Config here -->
</web-app>
xmlns属性的XML标准不是使用URI而不是URL吗?具体:xmlns:web=”“。如果没有原因出现在这里,我将在4周左右编辑答案。