This page last changed on Mar 13, 2005 by lars t.

This installation guide shows you how to configure OSCache for use inside your JSP pages. It assumes you have downloaded the latest version.

If you intend to use OSCache via the API rather than via the taglibs, these instructions do not apply. Just make sure oscache.jar is somewhere on your application's classpath.

Extraction Steps

  1. Extract the downloaded file to a directory of your choosing.
  2. Put the oscache.jar file in the /WEB-INF/lib directory
  3. Make sure commons-logging.jar is on your classpath (normally this also means putting it in /WEB-INF/lib).
  4. If you are using JDK 1.3.x it is optional, but strongly recommended, to add commons-collections.jar to your classpath. OSCache will use this to provide a significant speed increase. (Note that with JDK 1.4 and higher, commons-collections.jar will not be used - the 1.4 implementation is faster still).
  5. Put the /etc/oscache.properties file in the /WEB-INF/classes directory and edit the properties contained within it (for example if you want disk caching, configure the persistence listener and edit the cache.path property to point to where you want the cache files stored on disk). See the Configuration Guide for further details on what options are available.
  6. Remember to escape any \ characters in Windows paths - ie if you want cache files to go in c:\cachedir, the cache.path property should be set to c:\ \cachedir.
  7. Put the /etc/oscache.tld file in your /WEB-INF/classes directory.
  8. Your directory structure should now look something like this:

    $WEB_APPLICATION/WEB-INF/lib/oscache.jar
    $WEB_APPLICATION/WEB-INF/classes/oscache.properties
    $WEB_APPLICATION/WEB-INF/classes/oscache.tld

Installation Steps

  1. Add the following to your web.xml file
    <taglib>
              <taglib-uri>oscache</taglib-uri>
              <taglib-location>/WEB-INF/classes/oscache.tld</taglib-location>
        </taglib>
  2. Now add the appropriate tags to your JSP files and you're done.
  3. It should work properly. Tell us on the mailing list if it doesn't work in your container.
Logging

OSCache uses Jakarta Commons Logging for logging any messages. Please see the Commons Logging documentation for details on logging configuration.

Debugging

Note that OSCache has been compiled with debugging information enabled so you should be able to use your favourite debugger to step through the source if need be.

Servlet 2.3

You can omit putting the /etc/oscache.tld file in your /WEB-INF/classes directory and omit declaring OSCache in the WEB-INF/web.xml. You just have to add the following line declaring the OSCache custom tag library for use on the jsp page:

<%@ taglib uri="/oscache" prefix="oscache" %>

Note: With OSCache 2.1.1 the URI will be changed to http://www.opensymphony.com/oscache, see CACHE-61.
Document generated by Confluence on Apr 30, 2005 22:37