一、产生问题描述或背景

1.错误描述:

在建好的项目下创建servlet,采取右键new-servlet的方法。

web.xml之前是正常创建并且更新的,但是在web.xml出现错误之后就不再自动更新。

【报错】cvc-complex-type.2.4.a: Invalid content was found starting with element 'display-name'.

2.报错情况

cvc-complex-type.2.4.a: Invalid content was found starting with element 'display-name'. One of 

 '{"http://xmlns.jcp.org/xml/ns/javaee":servlet-class, "http://xmlns.jcp.org/xml/ns/javaee":jsp-file, "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.

二、解决方案

删掉报错的所在行代码

通过查资料,知道display-name 和 description 均属于描述性标签,则可删掉,程序也能运行。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-06-15
  • 2021-11-07
  • 2022-12-23
  • 2021-06-10
猜你喜欢
  • 2021-09-28
  • 2021-08-08
  • 2021-08-17
  • 2022-02-14
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案