Sun Java System logo     
JSTL Web Sample Application



JSTL Web Sample Application


This document describes how to utilize the Java Standard Tag Library (JSTL) Web sample application in conjunction with Sun Java (tm) System Application Server 7.

This sample application document contains the following sections:



Overview

The JSTL Web sample application demostrates how to use JSTL on the Sun Java (tm) System application server. The examples are ported from Jakarta's JSP(tm) Standard Tag Library implementation (1.0).

To better understand sample application source code, you may refer to the related javadocs which can be accessed at sjsas_install_dir/samples/webapps/jstl/javadocs/index.html after it is generated.



Compiling and Assembling the Application



This section contains instructions to compile and assemble the JSTL Web sample application.

  1. Go to sjsas_install_dir/samples/webapps/jstl/src/

    Execute the command asant



    Note You must add sjsas_install_dir/bin to your path.



    The default target core will be executed to build the WAR file.

  2. Deploy the application.

    After you have re-created the sample application from scratch, you may proceed to Deploying the Sample Application. Step 3 is optional.

  3. Clean the web application project area (optional).

    Execute the command asant clean to clean the web application.



Deploying the Sample Application

In this section, you will learn how to deploy the JSTL Web sample application.

Deploying the pre-built webapps-jstl.war file is simple. you may deploy by either Using the asant script or by Using the asadmin command.


Using the asant script

  1. Go to the src directory of the sample. For example:

    sjsas_install_dir/samples/webapps/jstl/src

  2. Run asant using deploy task. For example:

    %asant deploy


Using the asadmin command

  1. Go to sjsas_install_dir/samples/webapps/jstl/

  2. Execute the following:

    asadmin deploy -u <user-name> -w <password> -H <hostname> -p <admin server port> --instance <instance name> --type web webapps-jstl.war

The deployment process involves the following operations:

  • Authenticates against the local application server's administrative server

  • The WAR file is transferred to the administrative server

  • The administrative server begins the registration process:

    • Parses the EAR file and embedded JAR file

    • Explodes the bits into repository

    • Registers the J2EE application "webapps-jstl" by updating server.xml

If you would like to verify the registration of the application, you may proceed to Verifying Deployment. Otherwise, proceed to Running the Sample Application.


Verifying Deployment

As an optional step, you can use the Sun Java (tm) System 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, do the following:

Execute the command asadmin to look at applications deployed with a server instance. For example:

asadmin list-components -u <username> -w <password> -H <host> -p <admin-port> --type web <server instance name>

You will see the webapps-jstl module displayed as one of the listed components.


Undeploy the application

If you wish to undeploy the application after successful deployment, you may do so by either Using the asant script or by Using the asadmin command.


Using the asant script

  1. Go to sjsas_install_dir/samples/webapps/jstl/src

  2. Execute the following:

    asant undeploy


Using the asadmin command

  1. Go to sjsas_install_dir/samples/webapps/jstl/src

  2. Execute the following:

    asadmin undeploy -u <user-name> -w <password> -H <hostname> -p <admin server port> --instance <instance name> --type web webapps-jstl



Running the Sample Application

You may run the appliction through the following URL:

http://<AppServer hostname>:<port>/webapps-jstl/index.html



Troubleshooting



  • If you encounter problems when running the application, review the log files at sjsas_install_dir/domains/<domain-instance> /<server-instance>/logs/server.log to learn what exactly went wrong.

  • If the browser hangs after you click Import -> Absolute(FTP), it may be because the remote ftp server (ftp.gnu.org) is not ready.

Some Known Issues

  • The sample can not be deployed from the application server administration GUI, if Precompile JSPs option is selected. Solution is, try deploying the application without Precompile JSPs, or deploy using asant.

  • The sample can not be deployed using asadmin with option --precompilejsp=true. Solution is, try deploying the application without the option --precompilejsp=true, or deploy using asant.


Copyright © 2002 Sun Microsystems, Inc. All rights reserved.

Last Updated July 18, 2002