Eclipse抱怨网络应用程序属性 [英] Eclipse complaining about web-app attributes

查看:150
本文介绍了Eclipse抱怨网络应用程序属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的web.xml中的web应用声明是:

 < web-app 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>而$ e $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
$ b

 必须为元素类型web-app声明属性version

为什么Eclipse会抱怨这些属性?我在这里做错了吗?

解决方案

删除DOCTYPE行,这就是xsd的意图替换。我有同样的问题,只有这样才有效。


My web-app declaration in my web.xml is:

<web-app 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" >

And eclipse complains about all 4 attributes, here is one Eclipse complaint:

Attribute "version" must be declared for element type "web-app"

Why is Eclipse complaining about these attributes? Am I doing something wrong here?

解决方案

Remove the DOCTYPE line, that is what the xsd is meant to replace. I had the same issue and only this had worked.

这篇关于Eclipse抱怨网络应用程序属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆