XmlServlet Sample Page
click here for instructions on "Setting Up the Database"
 

This page demonstrates various ways to invoke XmlServlet from a web page.  It is possible to "hardcode" queries and other settings or to invoke XmlServlet from an interactive web page, and you can use parameterized queries, with values set from form controls. (Click the browser "back" button to get back to this page after making a selection)

EXAMPLE 1:  This XmlServlet query looks like a conventional link:
Sales Report, Third Quarter
 
 

EXAMPLE 2:  This XmlServlet query is a button with a hidden query that cannot be changed:


 
 

EXAMPLE 3: Here is a form with an XmlServlet query that can be edited:


 

EXAMPLE 4:  A parameterized XmlServlet query.

Display search results for this first name:

 

NOTES ON SETTING UP THE DATABASE

With the default configuration, XmlServlet will look for database:
     /JBuilder4/samples/JDataStore/datastores/Employee.jds
and run these queries against it  This works with the default setup oh Windows.  On Linux,
copy Employee.jds to that location or specify a different database as described below..

If you want to run these examples with a different database, you can either change the initialization parameters for XMLSERVLET in the XmlServlet configuration file, web.xml, or you can specifiy a connection in the query stings here.  For example, you could put this in the edit box for EXAMPLE 3:
   connection (path to EMPLOYEE.JDS); select * from addresses:
or
   connection (your driver) (your url); (your query)

The XmlServlet application is under the 'webapps' directory:  TOMCAT_HOME/webapps/XmlServlet  You can copy the servlet from there to the servlet area of your server, or you can run it with Tomcat.   Here  are notes on how to start Tomcat.