Reputation: 12583
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">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" />
The problem is with the includes. footer.html Looks like this:
<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>
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?
Upvotes: 22
Views: 34743
Reputation: 1
i am using eclipse 2024.3 and at window->preferences->web->HTML Files->Validation->Invalid tag location default is warning change to Ignore.
Upvotes: 0
Reputation: 15692
2018-01-07: Eclipse Oxygen.
Things may have changed in this regard since 2009, because what I find at the moment is that you can tweak HTML errors and warnings globally (Window --> Prefs --> Web --> HTML Files --> Validation), or you can tweak on a per-project basis: Project --> Properties --> Validation --> HTML Syntax.
For example I just set Text Regions --> Invalid text string to "Ignore" because I was getting spurious warnings for some Django HTML files with placeholders (or whatever they're called).
I also found that I was getting a warning for the hidden
attribute in DIVs: "your attribute should be followed by an = character". Oh dear: in HTML5 hidden
is a boolean
, Eclipse is therefore getting this wrong. I therefore set Attributes --> "Missing attribute equals sign character" to "Ignore" as well.
Upvotes: 0
Reputation: 5059
@ChssPly76 is correct, but I'd like to add that (using Mars), after following those steps, I was also required to re-validate the project to remove the warnings in the Problems section (right click project, validate).
Upvotes: 0
Reputation: 11372
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.
Upvotes: 1
Reputation: 59
im using myeclipse and at window->preferences->validation->jsp there is bunch of choices
Upvotes: 0
Reputation: 100776
Properties
-> Validation
(or you can go to Window
-> Preferences
-> Validation
to do this globally).Upvotes: 45