Sun Java System Application Server 

Samples Index

The Caching Web Sample Application

The Caching web application demonstrates how to use servlet and JavaServer Pages (JSP) results caching. Results caching improves application performance by enabling the Application Server to return cached results after the initial calls to JSP pages and servlets. Returning cached results is much faster than reinvoking Java code to generate content from scratch.

Building, Deploying, and Running the Application

The general instructions for building, deploying, and running sample applications are provided in Building, Deploying, and Running Sample Applications. In reading this document, use the following application-specific variables for this application:

Follow this general procedure:

  1. Build the Application. The build file, build.xml, is in the app_dir directory, specifically, install_dir/samples/webapps/apps/caching.
  2. Deploy the Application. The WAR file is install_dir/samples/webapps/apps/caching/webapps-caching.war.
  3. Run the Application. The application name is webapps-caching.

Running the Application

To run the application, enter the following URL in your browser:

http://hostname:port/webapps-caching/index.html

The deployment descriptor file sun-web.xml specifies the servlet caching attributes. If the input string is "one" or "two," the application caches results.

To turn the cache off or change the cache time-out value, modify the attributes of the cache element in sun-web.xml. To apply the changes, undeploy the application, rebuild the application, and then redeploy.


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