I have a servlet which is creating the jfree chart. By default it is returning tranfer-encoding as chunked. But I have to set the Content-Length in the response header.
final JFreeChart chart = ChartController.createChart();
final int chartWidth = ChartUtils.calculateWidth(request);
final int chartHeight = ChartHelper.getQuickViewChartHeight();
final ServletOutputStream out = response.getOutputStream();
response.setContentType("image/png");
ChartUtilities.writeChartAsPNG(out, chart, chartWidth, chartHeight);