Servlet 映射中的无效内容在哪里
Where is the Invalid Content in Servlet Mapping
获取以下无效 url 模式的错误。尝试完全按照 Telusko 的教程进行操作。 https://www.youtube.com/watch?v=wty6OROO__8&list=PLsyeobzWxl7pUPF2xjjJiG4BKC9x_GY46&index=6
我表单中的 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 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>
尝试 url-pattern,而不是 servlet-mapping inside tag servlet-mapping
<servlet-mapping>
<servlet-name></servlet-name>
<url-pattern></url-pattern>
</servlet-mapping>
获取以下无效 url 模式的错误。尝试完全按照 Telusko 的教程进行操作。 https://www.youtube.com/watch?v=wty6OROO__8&list=PLsyeobzWxl7pUPF2xjjJiG4BKC9x_GY46&index=6
我表单中的 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 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>
尝试 url-pattern,而不是 servlet-mapping inside tag servlet-mapping
<servlet-mapping>
<servlet-name></servlet-name>
<url-pattern></url-pattern>
</servlet-mapping>