老师帮忙看看我跟着视频敲的这个mapping映射为啥报错啊

来源:2-1 第一个Servlet

加1s的阿呱

2020-07-12 22:44:21

http://img.mukewang.com/climg/5f0b215a09850be110240768.jpghttp://img.mukewang.com/climg/5f0b217c097a3d8d05900340.jpghttp://img.mukewang.com/climg/5f0b219c0952a20d09380426.jpg报错信息:

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回答

mahsiaoko

2020-07-13

<servlet></servlet>

<servlet-mapping></servlet-mapping>

servlet这个标签中不应该包含有<servlet-mapping>这个标签

1

好帮手慕阿满

2020-07-13

同学你好,楼上同学指出了问题。

<servlet></servlet>和<servlet-mapping></servlet-mapping>标签是并列关系,不是包含关系。建议同学将<servlet-mapping></servlet-mapping>放在<servlet></servlet>后边再试试。

祝:学习愉快~

0

0 学习 · 16556 问题

查看课程