2017-12-31 126 views
0

サンプルアプリケーションを作成中にspring mvcの新機能ですが、web.xmlファイルにエラーがあります。web.xmlファイルのこの行に複数の注釈が見つかりました

これが私のWebアプリタグです:

<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". 
+0

共有あなたの完全な 'web.xml'ファイル –

+0

、web.xmlファイルを表示してください。 – rodgenk

+0

こんにちは、私の問題はur comments.The問題のおかげで解決された私のxmlファイルにXMLバージョンを追加していないです –

答えて

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"> 
関連する問題