Java Servlet映射中的无效内容在哪里
为无效的url模式获取以下erorr。试图完全按照Telusko的教程进行操作 我表单中的action属性设置为“add”,我尝试过使用或不使用正斜杠,但都没有成功。请帮忙。多谢各位Java Servlet映射中的无效内容在哪里,java,servlets,jakarta-ee,Java,Servlets,Jakarta Ee,为无效的url模式获取以下erorr。试图完全按照Telusko的教程进行操作 我表单中的action属性设置为“add”,我尝试过使用或不使用正斜杠,但都没有成功。请帮忙。多谢各位 cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-mapping'. One of '{"http:// xmlns.jcp.org/xml/ns/javaee":url-pattern}' is ex
cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-mapping'. One of '{"http://
xmlns.jcp.org/xml/ns/javaee":url-pattern}' is expected.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<servlet>
<servlet-name>abc</servlet-name>
<servlet-class>com.centeno.AddServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>abc</servlet-name>
<servlet-mapping>/add</servlet-mapping>
</servlet-mapping>
</web-app>
abc
com.centeno.AddServlet
abc
/加
尝试url模式,而不是servlet映射内部标记servlet映射
<servlet-mapping>
<servlet-name></servlet-name>
<url-pattern></url-pattern>
</servlet-mapping>