graph chart

Stacked Vertical Bar Graph Examples

[ Bar Graph Home ] [ Tutorials ] [ Documentation ] [ Getting Started ] [ Solutions ]

Servlet Example 2 - Data from a Server Side Process

If you do not see the graph image below then click here»

The servlet is setup here to read the configuration data from a text file and the graph data from a server side process, SVbarDataServlet.

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://localhost:8080/servlet/SVbarDataServlet"
width="450" height="440">

The SVbarDataServlet ( 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 data sources. eg. databases, files other server processes.

There are various methods by which the graphing servlet can be set to acquire data from databases including:-

Direct Database Binding
Database Script Interface

For a full discussion on the various methods and example scripts please see the
Tutorial section - click here.

For a full explanation of and range of values for the above parameters please see the Documentation - Configuration Options».

« back to Examples Index

« back to Getting Started

[ Bar Graph Home ] [ Tutorials ] [ Documentation ] [ Getting Started ] [ Solutions ]

 

 

The servlet examples are designed to run on the local machine and require that Servletrunner ( part of the JSDK environment ) has already been installed. If you haven't already done so then you should implement the JSDK environment first, see http://java.sun.com/products/servlet/

(The graph servlet will of course work with all servlet engines. If you wish to view the examples with another servlet engine then you will need to adjust the example pages to point to your servlet engine ).

Once you have installed the JSDK environment please copy all the files in the ./Servlet/ directory to the JSDK servlet directory ( usually c:\JSDK2.0\examples\ ). Now start the ServletRunner and then click on the examples below.

 

Getting Started

Documentation

Examples

Tutorials

Common Problems
This section describes and provides solutions to common problems.