org.apache.jcs.admin.servlet
Class JCSAdminServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.apache.velocity.servlet.VelocityServlet
              extended by org.apache.jcs.admin.servlet.JCSAdminServlet
All Implemented Interfaces:
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.

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)
          Velocity based admin servlet.
 
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, doHead, 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 Exception
Velocity based admin servlet.

Overrides:
handleRequest in class org.apache.velocity.servlet.VelocityServlet
Parameters:
request -
response -
context -
Returns:
Template
Throws:
Exception


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