I have a doubt on how adding a functionality. I have a page in jsp that loads an Applet, this Applet loads a Servlet which generates a graph with JFreeChart. This works correctly, but in the Servlet I have:
Code: Select all
........
response.setContentType("image/jpeg");
OutputStream myOutStream = response.getOutputStream();
JFreeChart myChart = crearChart();
int ancho = getParamEntero(request,"ancho",400);
int alto = getParamEntero(request,"alto",300);
ChartUtilities.writeChartAsJPEG(myOutStream,myChart,ancho,alto);
ChartUtilities.saveChartAsJPEG(new File("/usr/local/tomcat/webapps/Usuarios/graph1.jpg"), myChart, ancho, alto);
myOutStream.close();
.....
Code: Select all
ChartUtilities.saveChartAsJPEG(new File("/usr/local/tomcat/webapps/Usuarios/graph1.jpg"), myChart, ancho, alto);
Somebody can say to me why does not keep the image?
Thanks.[/b]