Sun Java System Application Server |
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.
sun-web.xml
). You can adjust the cache on/off and
cache time-outs settings at deployment time without any coding changes.
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:
install_dir
is the directory where Application Server is installed.
app_dir
is the application base directory: install_dir/samples/webapps/apps/caching
.
webapps-caching.war
.
Follow this general procedure:
build.xml
, is in the app_dir
directory, specifically, install_dir/samples/webapps/apps/caching
.
install_dir/samples/webapps/apps/caching/webapps-caching.war
.
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.