Bug 38129 - @include directive should include static content, not parsed
Summary: @include directive should include static content, not parsed
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Jasper (show other bugs)
Version: Unknown
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL: http://java.sun.com/products/jsp/synt...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-05 07:00 UTC by Ramon Casha
Modified: 2006-01-17 16:44 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ramon Casha 2006-01-05 07:00:45 UTC
The <@include ...> directive should statically include the text from the
specified file into the page at translation time (see specs at link). What is
actually happening is that the specified file is parsed as a JSP file, then
added. For instance it's not possible to have a "header.inc" and "footer.inc"
where taglib tags opened in the header are closed in the footer file - Jasper
gives an "Unterminated xxx tag" exception. That error should only occur if the
opened tag is not closed by the end of the "main" file.

The version of Tomcat is that included in JBoss 4.0.3 SP1 (version 5.5.x).
Comment 1 william.barker 2006-01-05 08:14:55 UTC
The JSP spec specifically forbids having an opening tag in one translation 
unit, and the closing tag in another.
Comment 2 Ramon Casha 2006-01-05 08:35:19 UTC
The JSP file and its static include files *together* are a translation unit. See
link below. So, a tag which is opened in one @include'd file and closed in
another is in the same translation unit.

http://java.sun.com/products/jsp/syntax/1.2/syntaxref1210.html
http://java.sun.com/products/jsp/tags/syntaxref.fm3.html: "A translation unit is
the JSP source file plus all of its static include files, but without any
dynamic include files."
Comment 3 Tim Funk 2006-01-18 01:44:00 UTC
And from your link, there is a link to 
http://java.sun.com/products/jsp/tags/syntaxref.fm6.html#8772 which states:

"This means that the parsed result of the included file is added to the JSP file
where the include directive is placed. Once the included file is parsed and
included, processing resumes with the next line of the calling JSP file."