Oracle GlassFish Server 3.0.1 Application Development Guide

Enabling JSP Caching

To globally enable JSP caching, set the jspCachingEnabled property to true. The default is false. For example:

asadmin set"true"

For more information about the asadmin set command, see the Oracle GlassFish Server 3.0.1 Reference Manual.

To enable JSP caching for a single web application, follow these steps:

  1. Extract the META-INF/appserv-tags.tld file from the as-install/glassfish/modules/web-glue.jar file.

  2. Create a new JAR file (for example, appserv-tags.jar) containing just the META-INF/appserv-tags.tld file previously extracted.

  3. Bundle this new JAR file in the WEB-INF/lib directory of your web application.

Note –

Web applications that use JSP caching without bundling the tag library are not portable.

Refer to GlassFish Server tags in JSP files as follows:

<%@ taglib prefix="prefix" uri="Sun ONE Application Server Tags" %>

Subsequently, the cache tags are available as <prefix:cache> and <prefix:flush>. For example, if your prefix is mypfx, the cache tags are available as <mypfx:cache> and <mypfx:flush>.