CS290I - Scalable Internet Services and Systems

Thorsten von Eicken - UCSB - Spring 2001

Project How-To: WebMacro

Class paths

To use WebMacro, you need to add the WebMacro jar

/cs290i/src/webmacro/webmacro.jar

to the wrapper.classpath in your server's jserv.properties.

Cache manager

WebMacro uses a cache manager to cache the templates after parsing them. This increases the performance dramatically, but affects debugging: if you change the template, you need to make sure that the cache manager reads the new copy. You have three choices here:

  1. Only add the above webmacro.jar to the class path. WebMacro tries to load the "VFC" cache manager, fails, and uses the SImpleCache manager. That one automatically reloads a template if it has changed.
  2. Also add /cs290i/src/webmacro/vfc.jar to the servlet engine class path so that WebMacro uses that faster cache manager. However, now changes to templates will not be detected.
  3. Same as option #2, but while you debug, add the following lines to your webmacro.properties file to use the SimpleCache manager:
    CachingProvider.template.CacheManager: org.webmacro.resource.SimpleCacheManager
    CachingProvider.url.CacheManager:      org.webmacro.resource.SimpleCacheManager
    SimpleCacheManager.*.ExpireTime: 30000
    SimpleCacheManager.*.ReloadOnChange: true

For additional info see: http://www.webmacro.org/ReleaseAndVfc.


Updated 05/03/2001