i want to show simple charts in JSPs with the JCharts library.
I already know how to generate them in a Servlet.
So if I open this servlet directly it displays the chart in the correct way. I just want to generate the chart in the servlet and then add it to the JSP. But how do I do that? I mean I can“t use getProperty like if I want to get a string so how can I access the encoded chart within the JSP?
You would save the image to a publicly accessible place in the file system, and then add a link to that file to your JSP.
Philipp Otto
Greenhorn
Joined: May 04, 2012
Posts: 4
posted
0
Thanks for your fast answer Tim :-)
I will try it but will the image be in the filesystem forever or is it just temporary for this session maybe? I mean if a lot of users want to see charts then there would be so many files in the file system.
Philipp
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2407
posted
0
If this was my problem I'd check out the cewolf tag library, which integrates chart generation and chart display with a JSP tag library. It can be set up to remove outdated images automatically (and also cache them, in case users request the same images over and over again).