我在 Eclipse 中为 SpringMVC web-app 编辑 web.xml 文件时收到此错误消息:
cvc-id.3:标识约束“web-app-servlet-name-uniqueness”的字段匹配元素“web-app”,但该元素没有简单类型。
这是我的 web.xml 的一部分:
<?xml version="1.0" encoding="UTF-8" ?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
Run Code Online (Sandbox Code Playgroud)
<servlet-name>dispatcher</servlet-name>声明中的错误点。我该怎么做才能解决它?先感谢您。