Class ProxyServlet

  • All Implemented Interfaces:
    java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, OptingServlet

    @SlingServlet(resourceTypes="nt:file",
                  extensions="html")
    public class ProxyServlet
    extends SlingSafeMethodsServlet
    implements OptingServlet
    Simple proxy servlet that include the request to a proxied resource. Dispatches ".html" requests to a "nt:file" that have a "sling:resourceType" property set on their "jcr:content" node, to the "jcr:content" resource.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      ProxyServlet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accepts​(SlingHttpServletRequest request)
      Examines the request, and return true if this servlet is willing to handle the request.
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.servlet.Servlet

        destroy, getServletConfig, getServletInfo, init, service
    • Constructor Detail

      • ProxyServlet

        public ProxyServlet()
    • Method Detail

      • accepts

        public boolean accepts​(SlingHttpServletRequest request)
        Examines the request, and return true if this servlet is willing to handle the request. If false is returned, the request will be ignored by this servlet, and may be handled by other servlets.

        Does not proxy for request to a nt:file that have no sling:resource type set in the jcr:content node.

        Specified by:
        accepts in interface OptingServlet
        Parameters:
        request - The request to examine
        Returns:
        true if this servlet will handle the request, false otherwise