One of the factors to consider when deciding between implementing the applet
or servlet form of the graph is that, some browsers have trouble printing applets. In addition the results can vary between browser
makes and versions.
servlet however returns the graph image to the browser
in PNG Image format and as such will print consistently
without any problems across all browser makes and versions.
factor to consider when deciding to implement the applet
or servlet is whether the interactive features of the
applet are required (mouseover pop-ups and mouseclick
URL functionality). In the servlet form, the graph is
returned to the browser as an image and as such the
interactive features of the applet are not available.
both the ability to print and the interactive features
are required then it is possible to implement both the
applet and servlet which work from the same data sources.
In this case the following solution is recommended,
1 - Create your html page which contains the applet
version of the graph, with all the interactive features,
configuring the applet to receive the data from either
files, server side scripts or databases.
2 - Create a copy of this page, replacing the
applet implementation with the servlet ( <IMG>
tag ), using exactly the same data sources as with
3 - On the applet page, place a little text footnote
at the bottom of the applet which says something like,
a printable version of this page please click here".
hyperlink, this text, to the page created in Step
this manor the page created in Step 1 will be
your main page with which your visitors will enjoy all
the interactive features of the applet. If a visitor
does wish to print the graph, then by clicking on the
text, the almost identical page created in Step 2
will be displayed. This will contain the graph in PNG
Image format and hence be universally printable.
an example of this please click