热点生成方法:public static String getFileName(HttpSession session,int h,int w,JFreeChart chart) throws IOException{
//
StandardEntityCollection sec = new StandardEntityCollection(); 
ChartRenderingInfo info = new ChartRenderingInfo(sec);

HttpServletResponse response=ServletActionContext.getResponse();
response.setContentType("image/png");
PrintWriter write = new PrintWriter(response.getWriter());

String filename=ServletUtilities.saveChartAsPNG(chart, w, h,info, session);
ChartUtilities.writeImageMap(write, filename, info, true);
write.flush();
System.out.println("标记下");
System.out.println(info);
return filename;
}action:                  //调用方法生成jfreechart成功无误
                  JFreeChart chart=JChartUtil.createPieChart2D("评价", dataset);
                  //调用上面的生成热点方法
String filename=JChartUtil.getFileName(session, 200, 300, chart);

                  //抛弃方法,直接生成无热点,只为测试
// JFreeChart chart=ChartFactory.createPieChart("饼图", dataset, true, true, false);
// String filename = ServletUtilities.saveChartAsPNG(chart, 300, 200, session);

String graphURL = request.getContextPath()+ "/servletDisplayChart?filename=" + filename;
request.setAttribute("filename", filename);
request.setAttribute("graphURL", graphURL);
return "succ";jsp:<img src="${request.graphURL }" border=0 usemap="#${request.filename }"/>
运行后的页面:重点在此处:
<map id="jfreechart-onetime-53843.png" name="jfreechart-onetime-53843.png">
<area shape="poly" coords="110,142,99,128,93,112,91,94,95,77,104,62,116,50,132,43,150,40,150,98,150,98" onMouseOver="return overlib('6: (100, 38%)');" onMouseOut="return nd();" nohref="nohref"/>
<area shape="poly" coords="208,101,205,117,198,132,186,144,172,152,156,157,139,156,124,151,110,142,150,98,150,98" onMouseOver="return overlib('5: (95, 36%)');" onMouseOut="return nd();" nohref="nohref"/>
<area shape="poly" coords="150,40,161,41,172,45,183,50,192,58,199,67,204,78,207,89,208,101,150,98,150,98" onMouseOver="return overlib('1: (67, 26%)');" onMouseOut="return nd();" nohref="nohref"/>
</map>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>center4</title>
<link rel="stylesheet" href="../../css/c.css" type="text/css"></link>
</head><body onload="doshow(0)" >
 <div class="all">
  <div class="right">
        <div class="chart">
        chart<br/>
        <img src="/suomeng1/servletDisplayChart?filename=jfreechart-onetime-53843.png" border=0 usemap="#jfreechart-onetime-53843.png"/>
        </div>
    </div>
 </div>
</body>
</html>
生成的map信息跑到了页面的首部,已经不再<html>标签之内了,页面直接把这么代码显示出来了。
求教,怎么解决,是我的热点写错了吗?