Hello, I'm having a little trouble with the way that jsp:directive.include works in Tomcat 5 (5.0.19 to be exact). I've read the JSP 2.0 spec, and it's confusing enough that I may well be misunderstanding it, but the way that the spec reads and the behavior I get from tomcat don't match at all! Here's the issue:
My files are all XML-style JSP documents. I expect from the spec that
adding <jsp:directive.include file="xxx.jspf"/> into my JSP document
should give me a result as if xxx.jspf had been cut and pasted into the
"master" JSP document. This isn't what is happening though. Instead, it
seems like xxx.jspf is skipping a processing step, or being processed as
a non-XML JSP file.
In the "master" jsp file, all comments like <!-- --> are stripped out,
and all character elements are processed a bit, so if I want an
ampersand in the final XHTML document, I need to say "&amp;". In the
included "xxx.jspf" file, though, <!-- --> comments are left in (and
make it all the way to the client), and character elements are left
alone as if they were inside CDATA blocks. This is annoying, especially
the comments; the comments are being treated as character data when tags
are evaluated, so tags that aren't supposed to have character data like
<c:choose> give errors unless I move all comments outside the <c:choose>
or inside an inner <c:when> tag. Furthermore, a lot of the comments are
notes to myself, and I would prefer that they not make it to the end
users.
So can somebody explain the rationale here? If I could understand why
things act this way, I could probably live with it, instead of getting
annoyed every time that I stumble across another include-related issue.
Even better, is there some way to get the behavior I expect - to process
an included JSP fragment exactly as if it were part of the original
XML-style JSP file. Thank you.
Bill Shubert ([EMAIL PROTECTED])
signature.asc
Description: This is a digitally signed message part
