我是靠谱客的博主 拼搏百合,这篇文章主要介绍【JavaWeb报错】cvc-complex-type.2.4.a: Invalid content was found starting with element 'display-name'.,现在分享给大家,希望可以做个参考。

一、产生问题描述或背景

1.错误描述:

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

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

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 均属于描述性标签,则可删掉,程序也能运行。

最后

以上就是拼搏百合最近收集整理的关于【JavaWeb报错】cvc-complex-type.2.4.a: Invalid content was found starting with element 'display-name'.的全部内容,更多相关【JavaWeb报错】cvc-complex-type.2.4.a:内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(61)

评论列表共有 0 条评论

立即
投稿
返回
顶部