I'm getting a couple of weird warnings in a JSP file:
Invalid location of tag (h4)
Invalid location of tag (p)
Here's my code:
<!DOCTYPE html>
<html>
<head>
</head>
<body role="document">
<div class="container container-white">
<div class="list-group col-sm-12">
<c:forEach var="recipe" items="${resultList}">
<a href="<c:url value="/recipe/viewRecipe/${recipe.id}"/>" class="list-group-item">
<h4 class="list-group-item-heading">${recipe.name}</h4>
<p class="list-group-item-text">${recipe.description}</p>
</a>
</c:forEach>
</div>
</div>
</body>
</html>
I'm using STS 3.6.4 and would prefer not to turn off html validation since it has been helpful in other contexts, given my spotty html skills. The code above is virtually identical to the Bootstrap sample Custom Content. I saw some posts regarding blocking elements not being allowed within an <a>
tag, but even the W3 site has a similar example:
<aside class="advertising">
<h1>Advertising</h1>
<a href="http://ad.example.com/?adid=1929&pubid=1422">
<section>
<h1>Mellblomatic 9000!</h1>
<p>Turn all your widgets into mellbloms!</p>
<p>Only $9.99 plus shipping and handling.</p>
</section>
</a> <a href="http://ad.example.com/?adid=375&pubid=1422">
<section>
<h1>The Mellblom Browser</h1>
<p>Web browsing at the speed of light.</p>
<p>No other browser goes faster!</p>
</section>
</a>
</aside>
I tried adding the <section>
tag to my code, but then I got the same invalid location warning on that tag.
Any ideas?
EDIT: I forgot to mention that the code as written does work correctly but I'd still like to get rid of the warnings, though, if possible. I've seen SO posts that mention Eclipse/STS JSP/HTML validation can be a bit flaky, but I haven't seen that in the 9 months I've been using it.