Web.xml问题找不到声明

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

这是我的web.xml的开始,其中发生了错误

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee; http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">

Eclipse显示了这两个错误:

Error 1 : cvc-elt.1: Cannot find the declaration of element 'web-app'. web.xml /"app.module"/src/main/webapp/WEB-INF line 5 XML Problem

Error 2 : Referenced file contains errors (jar:file:/C:/Program Files/eclipse/plugins/org.jboss.tools.as.catalog_3.2.4.v20170308-1740.jar!/schema/xsd/jboss-ejb3-spec-2_0.xsd).

java eclipse jboss xsd web.xml
1个回答
0
投票

尝试使用:

 <web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
      version="2.5">

© www.soinside.com 2019 - 2024. All rights reserved.