tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiroshi Iwatani <HGA03...@nifty.ne.jp>
Subject Re: FW: jsp:include tag does not preserve encoding of the text
Date Sat, 03 Apr 2004 10:40:05 GMT
In your deployment, html is handled by Apache and not processed by JSP/Servlet
engine. Included JSP inherit main-page setting. If you run Tomcat stand-alone
without other HTTP server, you will find its html handling characteristics.
I don't expect much from Tomcat, though ;-)

eMantra Information wrote:
> 
> hi
> 
> I am using Apache web server and Tomcat 4.1.
> 
> I have a jsp:include tag (in say test1.jsp) and I am trying to include a data1.html file.
This html file contains UTF-8 encoded text. When this JSP is executed, the UTF-8 text is displayed
as garbage characters.
> 
> 
> I have included following in the JSP
> <%@ page contentType="text/html; charset=UTF-8" %> 
> 
> 
> I have included following in the info.html
> <meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
> 
> However if I rename the info.html to data1.jsp and then include, the UTF-8 text gets
displayed correctly.
> 
> I suppose, the JSP engine does not interprete the content of the html file correctly
according to its encoding.
> Where as if it is a .jsp, then it is int erpreting it appropriately?
> 
> Can anybody throw some lite on this?
> 
> 
> regards
> haresh
> ////////////////////////////////////////////////////////////////////////////////////
> sample files.......
> 
> ////////////////////////////////////////////////////////////////////////////////////
> test1.jsp..........
> <%@ page contentType="text/html; charset=UTF-8" %> 
> 
> <% 
> 
> response.setContentType("text/html; charset=UTF-8");
> 
> %>
> 
> 
> 
> <HTML>
> 
> <HEAD>
> 
> <meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
> 
> </HEAD>
> 
> <BODY>
> 
> <jsp:include page="data1.html" flush="true"/>
> 
> </BODY>
> 
> </HTML>
> 
> ////////////////////////////////////////////////////////////////////////////////////
> data1.html.....
> 
> <meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
> <br>
> हाती घ्याल ते तडीस न्या.
> <br>
> 
> 

-- 
Hiroshi Iwatani

*stop cruelty* Annual number of institutionally euthanized cats and dogs 
including kittens and puppies: US 5 million, JP 500 thousand. How about your 
country? *for our better karma*
---------------------

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


Mime
View raw message