org.apache.sling.servlets.get.impl
Class DefaultHeadServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by org.apache.sling.api.servlets.SlingSafeMethodsServlet
          extended by org.apache.sling.servlets.get.impl.DefaultHeadServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class DefaultHeadServlet
extends SlingSafeMethodsServlet

The DefaultHeadServlet class implements default support for the HTTP HEAD request method. It basically wraps the response to provide output which does not really write to the client and the forwards to the same requested URL (resource actually) acting as if the request was placed with a GET method.

See Also:
Serialized Form

Constructor Summary
DefaultHeadServlet()
           
 
Method Summary
protected  void doHead(SlingHttpServletRequest request, SlingHttpServletResponse response)
          Handles the HEAD method.
 
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doGet, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHeadServlet

public DefaultHeadServlet()
Method Detail

doHead

protected void doHead(SlingHttpServletRequest request,
                      SlingHttpServletResponse response)
               throws javax.servlet.ServletException,
                      IOException
Description copied from class: SlingSafeMethodsServlet
Handles the HEAD method.

This base implementation just calls the SlingSafeMethodsServlet.doGet(SlingHttpServletRequest, SlingHttpServletResponse) method dropping the output. Implementations of this class may overwrite this method if they have a more performing implementation. Otherwise, they may just keep this base implementation.

Overrides:
doHead in class SlingSafeMethodsServlet
Parameters:
request - The HTTP request
response - The HTTP response which only gets the headers set
Throws:
javax.servlet.ServletException - Forwarded from the SlingSafeMethodsServlet.doGet(SlingHttpServletRequest, SlingHttpServletResponse) method called by this implementation.
IOException - Forwarded from the SlingSafeMethodsServlet.doGet(SlingHttpServletRequest, SlingHttpServletResponse) method called by this implementation.


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.