老师帮忙看看我跟着视频敲的这个mapping映射为啥报错啊
来源:2-1 第一个Servlet
加1s的阿呱
2020-07-12 22:44:21
报错信息:
Multiple annotations found at this line:
- cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-mapping'. One of '{"http://
xmlns.jcp.org/xml/ns/javaee":init-param, "http://xmlns.jcp.org/xml/ns/javaee":load-on-startup, "http://xmlns.jcp.org/
xml/ns/javaee":enabled, "http://xmlns.jcp.org/xml/ns/javaee":async-supported, "http://xmlns.jcp.org/xml/ns/
javaee":run-as, "http://xmlns.jcp.org/xml/ns/javaee":security-role-ref, "http://xmlns.jcp.org/xml/ns/javaee":multipart-
config}' is expected.
- <servlet-mapping>
2回答
<servlet></servlet>
<servlet-mapping></servlet-mapping>
servlet这个标签中不应该包含有<servlet-mapping>这个标签
好帮手慕阿满
2020-07-13
同学你好,楼上同学指出了问题。
<servlet></servlet>和<servlet-mapping></servlet-mapping>标签是并列关系,不是包含关系。建议同学将<servlet-mapping></servlet-mapping>放在<servlet></servlet>后边再试试。
祝:学习愉快~
相似问题