我在JSP裏面使用JFreeChart創建了一個圖表。我想使用JSP在網頁中呈現此圖表,而不將圖像存儲爲JPEG/PNG文件。這是在does not support writing to disk的谷歌應用程序引擎環境。在jsp裏面沒有存儲的渲染圖表
我試過如下:
java.awt.image.BufferedImage chartImage = targetChart.createBufferedImage(600,400);
ServletOutputStream out1 = response.getOutputStream();
JPEGImageEncoder encoder= JPEGCodec.createJPEGEncoder(out1);
,但最終得到一個
java.lang.IllegalStateException: STREAM
BTW,java.awt中也沒有在App Engine環境允許的。我有什麼選擇來解決這個問題?
+1,IMO google chart API值得推薦。 – dantuch 2011-08-20 11:40:25