GeeCON Prague 2014*
The moose likes Other Open Source Projects and the fly likes [JCharts] Accessing Charts in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "[JCharts] Accessing Charts in JSP" Watch "[JCharts] Accessing Charts in JSP" New topic
Author

[JCharts] Accessing Charts in JSP

Philipp Otto
Greenhorn

Joined: May 04, 2012
Posts: 4
Hey everybody,

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?

Thanks for your help.

Philipp
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
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
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: 2408
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).
 
GeeCON Prague 2014
 
subject: [JCharts] Accessing Charts in JSP