Class ServletInternalRequest


  • public class ServletInternalRequest
    extends InternalRequest
    Internal request that a Servlet or Script directly, after resolving it using a ServletResolver. This bypasses the Servlet Filters used by the default Sling request processing pipeline, which are often not needed for internal requests. That's more efficient than the SlingInternalRequest variant, but less faithful to the way Sling processes HTTP requests.
    • Field Detail

      • servletResolver

        protected final org.apache.sling.api.servlets.ServletResolver servletResolver
    • Constructor Detail

      • ServletInternalRequest

        public ServletInternalRequest​(@NotNull
                                      @NotNull org.apache.sling.api.servlets.ServletResolver servletResolver,
                                      @NotNull
                                      @NotNull org.apache.sling.api.resource.Resource resource)
        Setup an internal request to the supplied Resource, using the supplied servlet/script resolver.
    • Method Detail

      • toString

        public String toString()
        Return essential request info, used to set the logging MDC
        Overrides:
        toString in class Object
      • getExecutionResource

        protected org.apache.sling.api.resource.Resource getExecutionResource()
        Description copied from class: InternalRequest
        Provide the Resource to use to execute the request
        Specified by:
        getExecutionResource in class InternalRequest
      • delegateExecute

        protected void delegateExecute​(org.apache.sling.api.SlingHttpServletRequest request,
                                       org.apache.sling.api.SlingHttpServletResponse response,
                                       org.apache.sling.api.resource.ResourceResolver resourceResolver)
                                throws javax.servlet.ServletException,
                                       IOException
        Description copied from class: InternalRequest
        Execute the supplied Request
        Specified by:
        delegateExecute in class InternalRequest
        Throws:
        javax.servlet.ServletException
        IOException