在Eclipse中为Java EE开发人员版本禁用HTML警告

Ber*_*rez 21 html java eclipse warnings web-applications

我正在使用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" />
Run Code Online (Sandbox Code Playgroud)

问题在于包含.footer.html看起来像这样:

      <hr />
      <h3 class="alt"><b><a href="/copyright.html">Copyright</a> &copy; 2009</b> My Company. All rights reserved.</h3>
      <hr />
      <p>
        Visit <a href="/">Home</a>
      </p>

    </div>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

它放在大多数页面的底部.我真的很烦恼这些警告消息,比如Invalid location of tag (body).我知道它在此文件中无效,但另一方属于header.html.

在Java类中,您可以使用以下内容来抑制警告@SuppressWarnings("serial")......使用这些HTML或JSP文件的任何方式都可以执行此类操作吗?

Chs*_*y76 41

  1. 右键单击您的项目,Properties- > Validation(或者您可以转到Window- > Preferences- > Validation全局执行此操作).
  2. 取消选中"构建"以进行HTML语法验证或
  3. 单击"设置"下的省略号并添加规则以排除特定文件名/扩展名/您有什么

  • 注意:某些插件会覆盖这一点,无论你在验证时做什么,它都不会使它静音.我个人不得不在他们离开之前删除tk.eclipse.plugin.htmleditor. (2认同)