![](/img/trans.png)
[英]Can't add Google Plugin for Eclipse to Eclipse for Java EE developers (Helios edition)?
[英]Disable HTML Warnings in Eclipse for Java EE developers edition
我正在使用Eclipse for Java EE开发Web应用程序。 我有使用HTML文件构建的JSP文件作为包含。 我的index.jsp看起来像这样:
<jsp:include page="include/top.html" />
<title>Title!</title>
<jsp:include page="include/header.html" />
<jsp:include page="include/menu.html" />
<div class="span-15 prepend-1 last">
<h6>What is an <a href="http://en.wikipedia.org/wiki/Application_programming_interface">API</a>?</h6>
<p>An application programming interface (API) is an interface that software programs implement in order to allow other software to interact with it; much in the same way that software might implement a User interface in order to allow humans to interact with it.</p>
</div>
<jsp:include page="include/footer.html" />
问题在于包含。 footer.html看起来像这样:
<hr />
<h3 class="alt"><b><a href="/copyright.html">Copyright</a> © 2009</b> My Company. All rights reserved.</h3>
<hr />
<p>
Visit <a href="/">Home</a>
</p>
</div>
</body>
</html>
它放在大多数页面的底部。 我真的很烦恼这些警告信息,如Invalid location of tag (body).
我知道它在此文件中无效,但另一方属于header.html。
在Java类中,您可以使用@SuppressWarnings("serial")
类的内容来抑制警告...使用这些HTML或JSP文件可以做任何类似的事情吗?
Properties
- > Validation
(或者您可以转到Window
- > Preferences
- > Validation
以全局执行此操作)。 我知道解决这个问题的唯一方法是禁用项目的HTML验证。 右键单击有问题的项目并转到属性,然后转到验证菜单。 您可以禁用所有HTML验证,也可以进入“HTML语法”验证子菜单并禁用个别问题。
即时通讯使用myeclipse并在window-> preferences-> validation-> jsp中有很多选择
@ ChssPly76是正确的,但是我想添加它(使用Mars),在执行这些步骤之后,我还需要重新验证项目以删除Problems部分中的警告(右键单击项目, 验证 )。
2018-01-07:Eclipse Oxygen。
自2009年以来,这方面的情况可能已经发生了变化,因为我现在发现的是你可以全局调整HTML错误和警告(Window - > Prefs - > Web - > HTML Files - > Validation),或者你可以基于每个项目进行调整:项目 - >属性 - >验证 - > HTML语法。
例如,我只是将文本区域 - >无效的文本字符串设置为“忽略”,因为我收到了一些带有占位符的Django HTML文件的虚假警告(或者他们被称为的任何内容)。
我还发现我在DIV中收到hidden
属性的警告:“你的属性应该跟一个=字符”。 哦亲爱的:在HTML5中hidden
是一个boolean
,因此Eclipse会出错。 因此,我将属性 - >“缺少属性等于符号字符”设置为“忽略”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.