za.org.coefficient.servlet
Class ImageServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by za.org.coefficient.servlet.ImageServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ImageServlet
extends javax.servlet.http.HttpServlet

This servlet is used to serve up binary content off of the classpath. Usage will look like this: <img src="images?image=/za/org/coefficient/modules/issueTracker/images/bullet_creme.gif"$gt;
In the above example the image= value is the path, in the classpath, to the desired resource.

Version:
$Revision: 1.7 $
Author:
Dylan Etkin
See Also:
Serialized Form

Field Summary
private  java.util.Map contentCache
           
private  CoefficientInterceptor interceptor
           
 
Constructor Summary
ImageServlet()
           
 
Method Summary
 void destroy()
          Called by the servlet's container to indicate to the servlet that the servlet is being taken out of service.
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the serlet container (via the service method) to allow a servlet to handle a GET request making this method the entry point for the Project Engine user.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Called by the servlet container to handle a POST request.
private  java.lang.String getContentType(java.lang.String s)
           
 void init(javax.servlet.ServletConfig cfg)
          Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
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
 

Field Detail

contentCache

private java.util.Map contentCache

interceptor

private CoefficientInterceptor interceptor
Constructor Detail

ImageServlet

public ImageServlet()
Method Detail

destroy

public void destroy()
Called by the servlet's container to indicate to the servlet that the servlet is being taken out of service. Note: super.destroy() is NOT called. This method does nothing.

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

init

public void init(javax.servlet.ServletConfig cfg)
          throws javax.servlet.ServletException
Called by the servlet container to indicate to a servlet that the servlet is being placed into service. Note: this method calls super.init(cfg).

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
cfg - The ServletConfig instance used by the Servlet container to the current servlet.
Throws:
javax.servlet.ServletException

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Called by the serlet container (via the service method) to allow a servlet to handle a GET request making this method the entry point for the Project Engine user.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The HttpServletRequest instance.
response - The HttpServletResponse instance.
Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
execute(request,response) execute(request,response).

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Called by the servlet container to handle a POST request. This method calls doGet(request, response) to perform the job.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
doGet(HttpServletRequest, HttpServletResponse)

getContentType

private java.lang.String getContentType(java.lang.String s)


Copyright CSIR. All Rights Reserved.