ServletUtilities.saveChartAsPNG

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
xavier

ServletUtilities.saveChartAsPNG

Post by xavier » Sun Mar 09, 2003 10:01 pm

Hi,

Working on a Pie Chart, I have a problem when trying to display my chart using the ServletUtilities.saveChartAsPNG method.
My first action was to build my chart, save it in a file with the ChartUtilities.saveChartAsPNG method and adding a <IMG> tag in the HTML code build by my app. This was working fine.
I wanted to use the ServletUtilities.saveChartAsPNG method in order to bypass the step of generating a unique filename and having to manage some deletion later (I saw somewhere a way to do it through ServletUtilities). My problem is that I have the following error message and don't know what to do.

java.lang.NoSuchMethodError: javax.servlet.http.HttpSession.getAttribute(Ljava/lang/String;)Ljava/lang/Object;
at com.jrefinery.chart.servlet.ServletUtilities.registerChartForDeletion(Unknown Source)
at com.jrefinery.chart.servlet.ServletUtilities.saveChartAsPNG(Unknown Source)
at PieChart.(PieChart.java:52)
at EasyEntry.retirementBalance(EasyEntry.java:615)
at RetraiteServlet.doGet(RetraiteServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:715)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155)
at com.sun.web.core.InvokerServlet.service(InvokerServlet.java:168)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155)
at com.sun.web.core.Context.handleRequest(Context.java:414)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:139)




can you help ?

Tahnks.

Richard Atkinson

Re: ServletUtilities.saveChartAsPNG

Post by Richard Atkinson » Mon Mar 10, 2003 7:05 pm

You need to use a servlet engine that supports the JSP 1.1 / Servlet 2.2 specifications for that method call to work. If you do not have the option of
upgrading you can modify the source code to use getValue() and setValue() instead (both of which are now deprecated).

Regards,
Richard...

Locked