*
The moose likes Tomcat and the fly likes japanese problem in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "japanese problem in Tomcat " Watch "japanese problem in Tomcat " New topic
Author

japanese problem in Tomcat

mathew john
Greenhorn

Joined: Dec 14, 2004
Posts: 19
hi ,

i am using Tomcat 4.0. i am just trying to output japanese text to the browser.The code is as below for Japanse.jsp

<%@ include file='TestDEIncludeCharset.jsp'%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>

<%
String japanese = "����������o���o����";
out.println("japanse Text ------------------------>"+ japanese);
%>

<html>
<head>
<title>Japanse Text</title>
<meta http-equiv="Content-Type" content="text/html; charset="Shift_JIS">
</head>
<body>
������

<form name="form1" method="post" >
<input type="button" name="Submit2" value="����" >
</form>
</body>
</html>

And the code For TestDEIncludeCharset.jsp is as below.
<%@ page language = "java" contentType="text/html;charset=Shift_JIS" %>
<%
request.setCharacterEncoding("Shift_JIS");

%>

Now it works Well with Weblogic but in Tomcat japanese text is not displaying properly on the browser. Now if i copy the 2 lines of code in
TestDEIncludeCharset.jsp and paste it in place of the include it works in Tomacat. but i dont want to do this .

can somebody tell me why this is happening in Tomacat. and can somebody give me a wrk around for this

Thank you
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
Look at the generated class from that JSP page. You will see what actually happends within it.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Rahul Singh Khokhar
Ranch Hand

Joined: Feb 23, 2005
Posts: 36
Hi Mat,
First of all as Dave points out, have a look at the servlet generated to figure out whats happening with the Tomcat. You can find that file in the /works folder of your Tomcat.

Also, I would suggest, try Java Tag Libraries to include the files. As the problem in your case appears to be with the jsp file include.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: japanese problem in Tomcat