Setting up AppComposer
AppComposer provides a built-in web server process for testing
and debugging any servlets that you build. Before you begin building your servlets,
you should set up this web server so that you can see the results of your changes
as you go. Once you configure the web server, all you need to do is open your
browser to the web server's location to run or debug any servlets that are currently
open in AppComposer.
To use the built-in web server, you need to set certain preferences.
To enable the built-in web server:
- Start AppComposer.
Preferences from the
Edit -> Preferences...
- Click the
This tab allows you to set up a local web server for testing your work.
WebServerEnabled to true.
- You have the option to change the rest of the settings, but the defaults
should work for most machines:
- Choose a Server Port.
Note: If you do not use the default port number, make sure no other
processes are already using the port number you choose.
- Choose a URL directory for your servlets.
ServletAccessDirectory is set to a virtual directory
servlet. If you want the URL to point to a different
location instead, for instance to test that the servlet works from a path
matching the one it will have on deployment, specify its path relative
to the AppComposer installation directory here.
- Specify a directory for any nonservlet files.
URLOrDirectoryForNonServletRequests is set to
a directory called
public_html, inside the AppComposer
installation directory. If you wish to store such resources in another
location instead, specify its URL or its full or relative pathname here.
Full pathnames must start with a / and URLs begin with
- Set the number of parameters you can pass into a servlet.
For debugging purposes, AppComposer lets you pass parameters
from the browser to the servlet.
you set how many parameter fields AppComposerís parameters page
presents to you. You do not need to change the default number unless you
plan to use more than ten parameters.
Now AppComposer's local web server can run and debug your servlet
About the debug server
Once you configure the local web server, you can use it through a browser to
experiment with or debug your servlets. It is a good idea to familiarize yourself
with its functions.
To open the debug server page:
- If you do not currently have any servlets running in AppComposer,
open any capsule from the directory
- Open your favorite web browser to this address:
If you changed the default port number while configuring the debug server
in the procedure above, add a colon and the correct port number. For example:
The debug server page opens:
Note: Some browsers misinterpret the name localhost and try
www.localhost.com. If you encounter this behavior, use
the IP address instead of the name; open your browser to 127.0.0.1.
When you look at the debug server page it presents you with the following types
- The request headers: These are the HTTP protocol settings that the browser
and server use to communicate with each other. You do not need to configure
any of these settings. They include the types of files the server can decode,
the server's location, and a few other settings that the server and browser
need. Your values may differ from the ones displayed here.
- Parameters = : This lists parameters that have failed when you debug servlets.
- Links to open servlets: The page displays a link to every servlet you have
open in AppComposer. If you click on one of these links, your browser
opens a page to that servlet, just as if it were deployed on a publicly accessible
web server. Use these links to open your servlets and test their functionality
before you deploy them.
button opens a page that allows you to designate test parameters when you
use the debug server's debugging function. The page looks like this:
You can learn more about the debug server and how to use it to test your programs
in the tutorial section on Testing your Servlet.
Now that you have the debug server configured, you can use it to test your
web applications as you go. In the next section, you will build a simple servlet
and explore some of AppComposer's application-building features.
© 2003 DigiSlice Corporation