Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[JCharts] Accessing Charts in JSP

 
Philipp Otto
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2795
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 2795
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic