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.
Preferences
from the Edit
menu.Edit -> Preferences...
DebugServer
tab. WebServerEnabled
to true. ServletAccessDirectory
is set to a virtual directory
called 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. 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 http://
.
NumberOfPostParameters
lets
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. OK
.Now AppComposer's local web server can run and debug your servlet capsules.
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.
AppComposer/examples/
.
http://localhost/
http://localhost:90/
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 of information:
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.