[Eclipse]Servlet2.5 web.xml奇怪的报错 | 祭夜の咖啡馆
  • 公告

[Eclipse]Servlet2.5 web.xml奇怪的报错

JAVA 祭夜 7个月前 (03-10) 484次浏览 已收录 1个评论 扫描二维码
<servlet>
  	<servlet-name>WelcomeServlet</servlet-name>
  	<servlet-class>org.jiye.servlet.WelcomeServlet</servlet-class>
  	<load-on-startup>1</load-on-startup>
	<init-param>
		<param-name>initParam</param-name>
		<param-value>init</param-value>
	</init-param>
 </servlet>

报错:

Multiple annotations found at this line:
– cvc-complex-type.2.4.a: Invalid content was found starting with element ‘init-param’. One of
‘{“http://java.sun.com/xml/ns/javaee&#8221;:run-as, “http://java.sun.com/xml/ns/javaee&#8221;:security-role-ref}’ is
expected.
– Invalid element name:
– init-param

One of the following is expected:
– run-as
– security-role-ref

Error indicated by:
{http://java.sun.com/xml/ns/javaee}
with code:


嗯?什么玩意儿??运行不是挺正常的吗。。。

不过,换了个顺序就正常了:

  <servlet>
  	<servlet-name>WelcomeServlet</servlet-name>
  	<servlet-class>org.jiye.servlet.WelcomeServlet</servlet-class>
	<init-param>
		<param-name>initParam</param-name>
		<param-value>init</param-value>
	</init-param>
  	<load-on-startup>1</load-on-startup>
 </servlet>

奇奇怪怪的 #(喷)


祭夜の咖啡馆 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:[Eclipse]Servlet2.5 web.xml奇怪的报错
喜欢 (2)
[1690127128@qq.com]
分享 (0)
发表我的评论
取消评论
OwO表情
贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(1)个小伙伴在吐槽
  1. 又学习长知识了。
    Adoncn2021-09-23 05:40 (4天前)回复 Windows 10 | Firefox浏览器 56.0