当前位置: 首页 > 工具软件 > xmlweb > 使用案例 >

Spring 项目 web.xml 出错问题解决方案

伍成仁
2023-12-01

web.xml会莫名其妙的报错下面这种错误:

Multiple annotations found at this line:
	- Attribute "xmlns:xsi" must be declared for element type "web-app".
	- Attribute "xsi:schemaLocation" must be declared for element type "web-app".
	- Attribute "version" must be declared for element type "web-app".
	- The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-
	 mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-
	 local-ref*)".
	- Attribute "xmlns" must be declared for element type "web-app".

解决方案:
原因是<web-app>标签是必须处在第一行的,删掉<web-app>标签前面所有的内容,保证<web-app>标签处在第一行就行了。


 类似资料: