Bug 8982 - contentType in included file does not affect the parent
Summary: contentType in included file does not affect the parent
Status: RESOLVED DUPLICATE of bug 11656
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 4.0.3 Final
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-10 17:56 UTC by Jeff Plager
Modified: 2005-03-20 17:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Plager 2002-05-10 17:56:48 UTC
>
> I want to clarify the following scenario:
>
> I have two jsp's defined as follows
>
> includejsp.jsp:
>
> <%@ page contentType="text/html; charset=euc-kr" %>
>
> <br>
>
> Result of includejsp.jsp
>
> <br>
>
> <!-- Korean (1)*********/-->
>
> ÇÑ±Û Å×½ºÆ®
>
> <br>
>
> <%= "Test Include"%>
>
> <br>
>
> <br>
>
> -------------------
>
> and test.jsp defined as follows:
>
> <%@ include file="./includejsp.jsp" %>
>
> <br>
>
> <BR>
>
> Result of test.jsp
>
> <BR>
>
> <!-- Korean (2)*********/-->
>
> ÇÑ±Û Å×½ºÆ®
>
> <BR>
>
> Test Test!!!
>
> ----------------
>
> Should the  <%@ page contentType="text/html; charset=euc-kr" %> in
> includejsp.jsp affect how the characters are translated during the gernation
> process in test.jsp?  In Tomcat 4.03, the korean string in test.jsp is
> translated in unicode and the one in includejsp.jsp is translated properly.
>
> Thanks for any comments, Jeff.


As the charset of the contentType or pageEncoding charset should affect
the translation of the whole translation unit, both including page and
included page (in the sense of include directive).
Comment 1 william.barker 2002-05-10 18:14:20 UTC
Section 8.3 of the servlet spec forbids an included page from changing any 
headers.  In particular, it can't change content-type
Comment 2 Jeff Plager 2002-05-14 17:45:26 UTC
Maybe my original description was misleading.  What I mean is for pages doing
includes via the include directive, if the page being included specifies an 
encoding in the contentType attribute, should the parent not honour this 
encoding?  What I am seeing in 4.03 is only the included page is generated with 
the proper encoding. 
Comment 3 mmccourt 2003-02-10 14:29:03 UTC
Looks like a dupicate bug 11656.
Comment 4 Kin-Man Chung 2003-04-18 23:54:55 UTC

*** This bug has been marked as a duplicate of 11656 ***