Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Japanese Text not displayed on Image Generated by Servlet on winXP, Linux but displayed on Win2000

Reply
Thread Tools

Japanese Text not displayed on Image Generated by Servlet on winXP, Linux but displayed on Win2000

 
 
boney
Guest
Posts: n/a
 
      12-15-2006
hello All,

I have developed a web App sample (project Proposal Purpose) that
creates various Charts (bar, pie, time series...) using JFreeChart API.

I need to have Japanese text in all the labels of the Chart.

I gave hard coded Japanese text to the method that creates the chart
for diagnosis Purpose.

The problem is the Image of the Chart that is created has Japanese text
in the Labels on Win2000 Pro. But the Same application when deployed to
winXP and also on Fedora Core 6 does not have Japanese Text on the
Labels. it just has '???' in place of the text.

I am using J2sdk1.4.2, Tomcat 5.0.28 on all the 3 machines(win2000,
winXP, Fedora Core 6)
If the API doesnt support Japanese Input then the Labels shouldn't have
displayed Japanese text on win2000. Hence Can this be related to Tomcat
or JRE ???



My Servlet Code is as follows:

protected void doPost(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {

try {


DefaultCategoryDataset objDataset = new DefaultCategoryDataset();


String Series[] = {"男性","女性"};

String Category[] = {"ムンバイ", "デリー",
"アーマダバード"};

objDataset.addValue( new Double( 7000.0 ),Series[0] ,Category[0]
);

objDataset.addValue( new Double( 8000.0 ),Series[1] ,Category[0]
);

objDataset.addValue( new Double( 9000.0 ),Series[0] ,Category[1]
);

objDataset.addValue( new Double( 8000.0 ),Series[1] ,Category[1]
);

objDataset.addValue( new Double( 11000.0 ),Series[0] ,Category[2]
);

objDataset.addValue( new Double( 13000.0 ),Series[1] ,Category[2]
);

JFreeChart objChart = null;

objChart = ChartFactory.createBarChart(

"男性/女性 割合", //chart title

"町", //X Axis label

"人口", //Y Axis Label

objDataset,

PlotOrientation.HORIZONTAL, //plot orientation (Horizontal
Bar or Veritcal Bar)

true, // Is a legend required?

true, // Use tooltips

false // Configure chart to generate URLs?

);

HttpSession objSession = request.getSession();

ChartRenderingInfo objChartRenderingInfo = new
ChartRenderingInfo(new StandardEntityCollection());

String strFileName =
ServletUtilities.saveChartAsPNG(objChart,500,500,o bjChartRenderingInfo,objSession);

request.getSession().setAttribute("FileName",strFi leName);



RequestDispatcher objDispatcher = null;

objDispatcher =
getServletContext().getRequestDispatcher("/MyDisplayChart?filename=" +
strFileName);

objDispatcher.forward(request,response);
} catch(Exception ex) {

ex.printStackTrace();

}

}

 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      12-15-2006
boney wrote:
> The problem is the Image of the Chart that is created has Japanese text
> in the Labels on Win2000 Pro. But the Same application when deployed to
> winXP and also on Fedora Core 6 does not have Japanese Text on the
> Labels. it just has '???' in place of the text.


Perhaps you do not have a font installed on the other two machines that is
compatible with the font used to create the chart.

- Lew
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Servlet error ...package Javax.servlet does not exist cormacdebarra@gmail.com Java 4 11-11-2006 01:55 PM
Japanese text displayed incorrectly in Linux server Arjunan Venkatesh Java 2 03-15-2005 01:20 AM
seeking servlet "Master" keep getting "Master/servlet/Master" not found. Tomcat 5.0.25 Doug McCann Java 1 08-05-2004 09:16 PM
Perl script runs from command prompt but not from Task Scheduler in Win2000 kpowell10 Perl Misc 4 05-07-2004 10:44 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM



Advertisments