Advanced
Stacked Vertical Bar Graph, version 3.2
by Sirius Computer Consultants Limited
Servlet
Example 2
The
servlet is setup here to read the configuration data from
a text file and the graph data from a server side process,
in this case a Java Servlet running on our web server.
and
here is the HTML code,
<img
src="http://localhost:8080/servlet/SVbarchartServlet?
config=http://www.jpowered.com/bar_graph/svbargraph/Examples/barprops.txt&
data=http://www.jpowered.com/siriusjava/servlet/DataServlet"
width="450" height="420">
The DataServlet
( click here
to view code ) is a simple servlet designed to demonstrate
how a servlet can be used to return data to either the graphing
applet or servlet. As you will see the main routine ( doGet()
) uses the method GraphData() to construct the return data.
Although in this example the GraphData() routine simply builds
the return data from 'hard coded' values, in practice this
routine would be expanded to first gather data from any number
of datasources. eg. databases, files other server processes.