Servlet demo as JSP page
Servlet demo as JSP page
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.
Re: Servlet demo as JSP page
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.
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.
Re: Servlet demo as JSP page
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.
Re: Servlet demo as JSP page
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.
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.
Re: Servlet demo as JSP page
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...
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...