Hi all,
I'm using JFreeChart inside a servlet. For my need, I have to create a temporary JPEG file and put its pathname in a XML file for a global PDF rendering.
The problem is that the method ServletUtilities.saveChartAsJPEG doesn't return the absolute (or relative) path, but only the filename. When the PDF renderer tries to read the JPEG file, it gets a FileNotFoundException...
Is there any solution to get the path of the file created by saveChartAsJPEG ?
Thanks,
Lanto
filename returned by ServletUtilities.saveChartAsJPEG
Re: filename returned by ServletUtilities.saveChartAsJPEG
The ServletUtilities class saves the file in the temp directory so you can use the System Property "java.io.tmpdir" to determine exactly where it is. Take a look at the source of the DisplayChart servlet to see an example of using a temp file. The critical line is
File file = new File(System.getProperty("java.io.tmpdir"), filename);
Hope this helps.
Regards,
Richard...
File file = new File(System.getProperty("java.io.tmpdir"), filename);
Hope this helps.
Regards,
Richard...
Re: filename returned by ServletUtilities.saveChartAsJPEG
Hi Richard,
Thanks for your answer.
Lanto
Thanks for your answer.
Lanto