You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "William M. Shubert" <wm...@igoweb.org> on 2004/06/09 01:12:16 UTC

jsp:directive.include behavior

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;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 (wms@igoweb.org)

Re: jsp:directive.include behavior

Posted by Robert Koberg <ro...@koberg.com>.
I have the same problem (expanded entities). It works the same in Resin. 
I posted a question about this a week or so ago. Maybe we should ask on Dev?

Is the XML syntax being used?

best,
-Rob


William M. Shubert wrote:

> 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;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 (wms@igoweb.org)


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org