I'm new to JFreeChart and need some help on how to render the png image generated by action class on to jsp. There are options of saving the image in a temp dir and them reading from there, but my requirement is not to involve in any io operations and generate the chart on the fly.
method in my action class
TestAction
------------------------------------------------------------------------------
JFreeChart chart = new JFreeChart("Title", JFreeChart.DEFAULT_TITLE_FONT, plot, false);
ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
response.setHeader("Content-Type", "image/png");
response.setContentType("image/png");
ChartUtilities.writeChartAsPNG(response.getOutputStream(), chart, 500, 300, info);
response.getOutputStream().flush();
response.getOutputStream().close();
------------------------------------------------------------------------------
img tag in jsp callign above action
<img src="<%= contextPath %>/testChart.do?dispatch=generateChart" width=500 height=300 border=0>
I think the image is being generating, as I can see some encoded data on the calling jsp page. However this is not helpful

Please let me know if I'm missing anything? Any help is much appreciated.
Thanks,
NJ