日期:2014-05-19  浏览次数:20662 次

JFREEchart 画的图看不到是什么情况??
从来没用过这东西 一个现成的例子  
<%
  DefaultCategoryDataset dataset = new DefaultCategoryDataset();
  dataset.addValue(610,"广州","猪肉");
  dataset.addValue(220,"广州","牛肉");
  dataset.addValue(530,"广州","鸡肉");
  dataset.addValue(340,"广州","鱼肉");
  JFreeChart chart = ChartFactory.createBarChart3D("肉类销量统计图",
  "肉类",
  "销量",
  dataset,
  PlotOrientation.VERTICAL,
  false,
  false,
  false);
 
 String filename = ServletUtilities.saveChartAsPNG(chart,300,300,null,session); 
 String graphURL = request.getContextPath() + "/DisplayChart?filename" + filename;  
%>
<body>
你好!<%=graphURL%><br/>
<img src="1.jpg">
<img src="<%=graphURL%>" width=300 height=300 border=0 usemap="#<%=filename%>"/>
</body>
</html>
那个graphURL是/jfreeChart/DisplayChart?filenamejfreechart-4032334436525144738.png 但是图片无法正常显示
然后我用这个直接去访问就报错
http://localhost:8080/jfreeChart/DisplayChart?filenamejfreechart-4032334436525144738.png

错误提示是
严重: Servlet.service() for servlet DisplayChart threw exception
javax.servlet.ServletException: Parameter 'filename' must be supplied
at org.jfree.chart.servlet.DisplayChart.service(DisplayChart.java:106)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662)
求解释啊


------解决方案--------------------
怎么都不可以上传本地图片