org.apache.myfaces.trinidad.webapp

## Class ResourceServlet

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - org.apache.myfaces.trinidad.webapp.ResourceServlet

- All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

      public class ResourceServlet
      extends javax.servlet.http.HttpServlet

  A Servlet which serves up web application resources (images, style sheets, JavaScript libraries) by delegating to a ResourceLoader. The servlet path at which this servlet is registered is used to lookup the class name of the resource loader implementation. For example, if this servlet is registered with name "resources" and URL pattern "/images/*", then its servlet path is "/images". This is used to construct the class loader lookup for the text file "/META-INF/servlets/resources/images.resources" which contains a single line entry with the class name of the resource loader to use. This technique is very similar to "/META-INF/services" lookup that allows the implementation object to implement an interface in the public API and be used by the public API but reside in a private implementation JAR.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEBUG_INIT_PARAM` Context parameter for activating debug mode, which will disable caching.
    `static long` | `ONE_YEAR_MILLIS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceServlet()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `destroy()` Override of Servlet.destroy();
    `protected void` | `doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` Override of HttpServlet.doGet()
    `protected long` | `getLastModified(javax.servlet.http.HttpServletRequest request)` Override of HttpServlet.getLastModified()
    `protected String` | `getResourcePath(javax.servlet.http.HttpServletRequest request)` Returns the resource path from the http servlet request.
    `void` | `init(javax.servlet.ServletConfig config)` Override of Servlet.init();
    `void` | `service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)`

    - ### Methods inherited from class javax.servlet.http.HttpServlet

      `doDelete, doHead, doOptions, doPost, doPut, doTrace, 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

    - #### DEBUG_INIT_PARAM

          public static final String DEBUG_INIT_PARAM

      Context parameter for activating debug mode, which will disable caching.
      See Also:
        Constant Field Values

    - #### ONE_YEAR_MILLIS

          public static final long ONE_YEAR_MILLIS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ResourceServlet

          public ResourceServlet()

  - ### Method Detail

    - #### destroy

          public void destroy()

      Override of Servlet.destroy();
      Specified by:
        `destroy` in interface `javax.servlet.Servlet`
      Overrides:
        `destroy` in class `javax.servlet.GenericServlet`

    - #### init

          public void init(javax.servlet.ServletConfig config)
                    throws javax.servlet.ServletException

      Override of Servlet.init();
      Specified by:
        `init` in interface `javax.servlet.Servlet`
      Overrides:
        `init` in class `javax.servlet.GenericServlet`
      Throws:
        `javax.servlet.ServletException`

    - #### service

          public void service(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response)
                       throws javax.servlet.ServletException,
                              IOException

      Specified by:
        `service` in interface `javax.servlet.Servlet`
      Overrides:
        `service` in class `javax.servlet.http.HttpServlet`
      Throws:
        `javax.servlet.ServletException`
        `IOException`

    - #### doGet

          protected void doGet(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
                        throws javax.servlet.ServletException,
                               IOException

      Override of HttpServlet.doGet()
      Overrides:
        `doGet` in class `javax.servlet.http.HttpServlet`
      Throws:
        `javax.servlet.ServletException`
        `IOException`

    - #### getLastModified

          protected long getLastModified(javax.servlet.http.HttpServletRequest request)

      Override of HttpServlet.getLastModified()
      Overrides:
        `getLastModified` in class `javax.servlet.http.HttpServlet`

    - #### getResourcePath

          protected String getResourcePath(javax.servlet.http.HttpServletRequest request)

      Returns the resource path from the http servlet request.
      Parameters:
        `request` - the http servlet request
      Returns:
        the resource path

Copyright © 2001-2017 The Apache Software Foundation. All Rights Reserved.