org.apache.jcs.admin.servlet
Class JCSAdminServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.apache.velocity.servlet.VelocityServlet
              extended byorg.apache.jcs.admin.servlet.JCSAdminServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JCSAdminServlet
extends org.apache.velocity.servlet.VelocityServlet

A servlet which provides HTTP access to JCS. Allows a summary of regions to be viewed, and removeAll to be run on individual regions or all regions. Also provides the ability to remove items (any number of key arguments can be provided with action 'remove'). Should be initialized with a properties file that provides at least a classpath resource loader. Since this extends VelocityServlet, which uses the singleton model for velocity, it will share configuration with any other Velocity in the same JVM. Initialization in a webapp will look something like this:

 
   [servlet]
       [servlet-name]JCSAdminServlet[/servlet-name]
       [servlet-class]org.apache.jcs.admin.servlet.JCSAdminServlet[/servlet-class]
       [init-param]
           [param-name]properties[/param-name]
           [param-value]WEB-INF/conf/JCSAdminServlet.velocity.properties[/param-value]
       [/init-param]
   [/servlet]
  
 
FIXME: It would be nice to use the VelocityEngine model so this can be truly standalone. Right now if you run it in the same container as, say, turbine, turbine must be run first to ensure it's config takes precedence.

Version:
$Id: JCSAdminServlet.java,v 1.13 2005/06/04 02:01:59 asmuts Exp $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.velocity.servlet.VelocityServlet
CONTENT_TYPE, DEFAULT_CONTENT_TYPE, DEFAULT_OUTPUT_ENCODING, INIT_PROPS_KEY, REQUEST, RESPONSE
 
Constructor Summary
JCSAdminServlet()
           
 
Method Summary
protected  org.apache.velocity.Template handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.velocity.context.Context context)
           
 
Methods inherited from class org.apache.velocity.servlet.VelocityServlet
chooseCharacterEncoding, createContext, doGet, doPost, doRequest, error, getTemplate, getTemplate, handleRequest, init, initVelocity, loadConfiguration, mergeTemplate, requestCleanup, setContentType
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCSAdminServlet

public JCSAdminServlet()
Method Detail

handleRequest

protected org.apache.velocity.Template handleRequest(javax.servlet.http.HttpServletRequest request,
                                                     javax.servlet.http.HttpServletResponse response,
                                                     org.apache.velocity.context.Context context)
                                              throws java.lang.Exception
Throws:
java.lang.Exception
See Also:
VelocityServlet.handleRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.velocity.context.Context)


Copyright © 2002-2005 Apache Software Foundation. All Rights Reserved.