Servlet demo as JSP page

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Guy Rouillier

Servlet demo as JSP page

Post by Guy Rouillier » Mon Oct 07, 2002 8:58 pm

I've converted the servlet demo to a JSP page if anyone is interested. I uploaded a previous version but it never showed up in the list of contributions, so I guess not a large enough population is interested.

David Gilbert

Re: Servlet demo as JSP page

Post by David Gilbert » Tue Oct 08, 2002 3:53 pm

Hi Guy,

I'm interested, I must have overlooked the previous version or forgotten it somewhere along the line.

One other note, the Cewolf project provides a tag library for JFreeChart:

http://cewolf.sourceforge.net/

I've seen some good reviews of Cewolf.

Regards,

DG.

Guy Rouillier

Re: Servlet demo as JSP page

Post by Guy Rouillier » Tue Oct 08, 2002 6:20 pm

Ok, I'll upload jspdemo.zip. It has the JSP page in it as well as a brief read.me describing the changes I had to make to the servlet demo when converting to JSP.

Soren

Re: Servlet demo as JSP page

Post by Soren » Wed Oct 09, 2002 8:55 am

Hello,

Where can you find this JSP example?

Cheers,

Soren

Guy Rouillier

Re: Servlet demo as JSP page

Post by Guy Rouillier » Wed Oct 09, 2002 4:43 pm

I put the sample here:

https://sourceforge.net/tracker/index.p ... tid=365494

Note this is just a straight conversion of the servlet demo, and not exactly how you would use a chart in a real page. Particularly, the page (and the servlet from which it is derived) writes the image directly into the output stream, making the graph the entire contents of the page. In reality, what you normally would do is to write the image to a file, and have a URL to that file on your JSP page.

If anyone is interested, I could come up with a variation of this sample which shows how to do that.

Richard Atkinson

Re: Servlet demo as JSP page

Post by Richard Atkinson » Wed Oct 09, 2002 5:30 pm

I put together a sample WAR file that is primarily for demonstrating using JFreeChart to generate charts with tooltips and a drilldown capability in a servlet/JSP environment. However it also shows how to use JFreeChart to persist a chart into the temporary directory and then use a JFreeChart generic servlet (com.jrefinery.chart.servlet.DisplayChart) to stream the chart to the client.

There are additional advantages that the charts created by a particularly user are deleted at the end of their session and one user cannot access another user's charts. It is also possible to have the web server on a different machine to the servlet engine because the charts are being streamed rather than written into an HTTP accessible part of the file system.

There is more information and the WAR file to download from http://homepage.ntlworld.com/richard_c_ ... freechart/

I hope you find it useful.

Regards,
Richard...

Locked