views:

518

answers:

3

I am working on a Web App with Eclipse for Java EE. I have JSP files that are built with HTML files as includes. My index.jsp looks like this:

<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"&gt;API&lt;/a&gt;?&lt;/h6&gt;
        <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" />

The problem is with the includes. footer.html Looks like this:

      <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>

Which gets put at the bottom of most pages. And I'm really annoyed with these warning messages like Invalid location of tag (body). I know its invalid within this file but the other side belongs with header.html.

In Java classes you can suppress warnings with things like @SuppressWarnings("serial") ... Any way to do something like this with these HTML or JSP files?

A: 
  1. Right click on your project, Properties -> Validation (or you can go to Window -> Preferences -> Validation to do this globally).
  2. Uncheck "Build" for HTML syntax validation OR
  3. Click ellipsis under "Settings" and add a rule to exclude specific file name / extension / what have you
ChssPly76
The project is checked out from Version Control, so it would be nice to suppress these warnings for other users. But this works for me =)
Bernie Perez
If you do this per project (as opposed to globally), settings are saved in your `.project` file which you can then check into version control.
ChssPly76
A: 

im using myeclipse and at window->preferences->validation->jsp there is bunch of choices

A: 

The only way that I'm aware of to solve this is to disable HTML validation for the project. Right click the project in question and go to properties, then go to the validation menu. You can either disable all HTML validation or go into the "HTML Syntax" validation sub-menu and disable individual problems.

Jared Russell