在web.xml文件中的此行找到多个注释

问题描述 投票:0回答:1

在创建示例应用程序时,我是初次使用spring mvc我在web.xml文件中有错误。

这是我的网络应用标签:

<web-app id="WebApp_ID" version="2.4" 
    xmlns="http://java.sun.com/xml/ns``/j2ee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">   

我收到错误:

在此行找到多个注释:

- Attribute "version" must be declared for element type "web-app".
- Attribute "xsi:schemaLocation" 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".
- Attribute "xmlns:xsi" must be declared for element type "web-app".
java spring spring-mvc web.xml
1个回答
0
投票

您的web.xml包含不必要的字符:“``”

正确的web.xml:

<web-app id="WebApp_ID" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
© www.soinside.com 2019 - 2024. All rights reserved.