- This topic has 8 replies, 2 voices, and was last updated 20 years, 1 month ago by Wim Goossens.
-
AuthorPosts
-
Wim GoossensMemberHi,
I get an ‘Invalid location of tag (td)’ warning when using jsp fragments.
MyEclipse 3.8.2 QF 20041020
Eclipse 3.0.1 Build id: 200409161125Source code to reproduce (3 files):
1. xbegin.jspf :
<table>
<tr>2. xend.jspf :
</tr>
</table>3. xmain.jsp :
<jsp:root
xmlns:jsp=”http://java.sun.com/JSP/Page”
version=”2.0″>
<jsp:output doctype-root-element=”html”
doctype-public=”-//W3C//DTD XHTML 1.1//EN”
doctype-system=”http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd” />
<jsp:directive.page contentType=”text/html” />
<html>
<head>
<jsp:element name=”title”>
<jsp:body>xmain</jsp:body>
</jsp:element>
</head>
<body>
<jsp:directive.include file=”xbegin.jspf” />
<td>test</td>
<jsp:directive.include file=”xend.jspf” />
</body>
</html>
</jsp:root>It would be nice without this warning.
Regards,
Wim
Riyad KallaMemberWim,
I suggest turning off HTML validation if you are using includes in this fashion. The HTML validator is pretty picky and expects strict HTML 4.01 which almost no one does 😉
Wim GoossensMemberRiyad,
When you have got the time, could you clarify this a little bit more ?
Regards,
Wim
Riyad KallaMemberWim,
Clarify which part? How to turn the validator off or why?
Wim GoossensMemberRiyad,
My problem is that the result of this code :
<jsp:directive.include file=”xbegin.jspf” />
<td>test</td>
<jsp:directive.include file=”xend.jspf” /><jsp:directive.include … is just a static file include, so I think the
html validator sees this code :<table>
<tr>
<td>test</td>
</tr>
</table>I don’t see what the problem is with this code for the html validator ?
Regards
Wim
Riyad KallaMemberWim,
This is one of the reasons I was suggesting to turn off the HTML validator, the HTML you have above isn’t valid according to HTML 4.01 spec, you actually are missing <tbody> tags either around your <tr> or <td> tags, I forget which. Also I’m not certain that the validator will “see” the finished page since its a runtime evaluation… have you tried using <%@ include %> directives?
Wim GoossensMemberRiyad,
I use XHTML but this specific html does validate as valid HTML 4.01 (strict and tansitional, for the <table>…</table> part)
The use of <tbody> tags around <tr> tags is not needed.<jsp:directive.include is the xml equivalent of <%@ include directive jsp syntax
In this case (xmain.jsp) the use of <%@ include directive is not allowed.I think this is a (small) bug. But because it is the ONLY (html/jsp) one,
i thought it would be nice to have it fixed in the 3.8.3 release.
This is also why i do not turn off the HTML validator. It seems to work nicely for me.Regards
Wim
Riyad KallaMemberWim, I duplicated this and will file it. Thank you for your patience.
Wim GoossensMemberRiyad, Thank you and all the other people in the support team
for their excellent work. -
AuthorPosts