Simple Web Sample Application |
Simple Web Sample ApplicationThis document describes how to use the Simple Web sample application in conjunction with the Application Server.
Overview
The Simple Web sample application is a collection of simple servlets and JSPs that demonstrate the usage of the Servlet and the JSP specification.Assembling this application and deploying it to the Application Server introduces you to the Application Server Admin Tool.
The following instructions describe how to manually deploy the application. You may want to experiment by modifying and redeploying the sample.
To better understand the sample application source code, you may refer to the related javadocs which can be accessed at <install_root>/samples/webapps/apps/simple/javadocs/index.html after it is generated.
Setting up the environment
To successfully deploy and run the Simple Web sample application, several resources need to be setup with the Application Server. These resources include Javamail and JNDI resources.The build scripts provided will automatically register all the above resources with Application Server.
Compiling and Assembling the Application
This section contains instructions to build and assemble the Simple Web sample application using a Command Line Interface (CLI).To rebuild the entire application from scratch, follow these steps:
- Compile and assemble the application. For example: execute the command
asant
under<install_root>/samples/webapps/apps/simple/
. to execute the default targetcore
and rebuild the WAR files.- Deploy the application. After you have re-created the sample application from scratch, you may proceed directly to Deploying the Sample Application, or optionally perform step 3.
- Clean the application project area (optional). To remove the sample application, assemble and build directories, execute the command
asant clean
Now you are ready to use this WAR file for deployment.
Deploying the Sample Application
To deploy the application, do the following:Execute the command asant deploy under <install_root>/samples/webapps/apps/simple
This will deploy the webapps-simple.war file located under <install_root>/samples/webapps/apps/simple
Note: You must run
Verifying Deploymentasant undeploy
before redeploying this sample. This will ensure that all modules are undeployed and the resources are disabled.As an optional step, you can use the Application Server Administration Tool to verify that the application has been registered. Otherwise, proceed directly to Running the Sample Application.
To verify the registration of the application:
- Execute the command
asadmin list-components
to look at applications deployed with a server instance. For example:
asadmin list-components --user <username> --password <password>
You will see
webapps-simple
listed.- Alternately, use Admin Console and navigate to Applications > Web Applications. You will see
webapps-simple
listed.Running the Sample Application
You can run the application through the following URL:http://<hostname>:<port>/webapps-simple
Traverse the JSP and Servlet links to execute each simple web sample application.
Troubleshooting
If you encounter problems when running the application, review the log files at <install_root>/domains/<domain_name>/logs/server.log to learn what exactly went wrong.
Copyright © 2003 Sun Microsystems, Inc. All rights reserved.
Last
Updated October 2, 2003