juju.reattore.server.intercept.impl
Class VelocityInterceptor

java.lang.Object
  |
  +--juju.reattore.server.intercept.impl.VelocityInterceptor
All Implemented Interfaces:
Interceptor
Direct Known Subclasses:
AutoIndexInterceptor, StatInterceptor

public class VelocityInterceptor
extends java.lang.Object
implements Interceptor

Interceptor that serves a Apache Velocity based template.


Constructor Summary
VelocityInterceptor()
          Create a new interceptor
 
Method Summary
protected  boolean populateContext(org.apache.velocity.VelocityContext ctx, HttpRequest req, HttpResponse resp)
          Hook to allow a derrived class to add extra items to the context.
 boolean process(HttpRequest req, HttpResponse resp)
          Process an incoming HTTP request if possible, filling in the given response as it goes.
 void setLockedPath(java.lang.String path)
          Lock this interceptor to only ever return the contents of the given path no matter what the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VelocityInterceptor

public VelocityInterceptor()
Create a new interceptor

Method Detail

setLockedPath

public void setLockedPath(java.lang.String path)
Lock this interceptor to only ever return the contents of the given path no matter what the request.

Parameters:
path - The path to lock to, or null to clear.

populateContext

protected boolean populateContext(org.apache.velocity.VelocityContext ctx,
                                  HttpRequest req,
                                  HttpResponse resp)
Hook to allow a derrived class to add extra items to the context.

Parameters:
ctx - Main context
req - Incoming request
resp - Outgoing response
Returns:
true if the request was handled and processing should abort.

process

public boolean process(HttpRequest req,
                       HttpResponse resp)
Description copied from interface: Interceptor
Process an incoming HTTP request if possible, filling in the given response as it goes. An interceptor may have side effects without actually performing the main processing and may pass it on to another interceptor. A authentication interceptor is a good example.

Specified by:
process in interface Interceptor
Parameters:
req - HTTP request to process
resp - Response to fill in
Returns:
true if the request was recognised and processed.
See Also:
Interceptor


Copyright © 2002-2003 Michael Hope. All Rights Reserved.