Class ServletInternalRequest
- java.lang.Object
-
- org.apache.sling.servlethelpers.internalrequests.InternalRequest
-
- org.apache.sling.servlethelpers.internalrequests.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 theSlingInternalRequestvariant, but less faithful to the way Sling processes HTTP requests.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.sling.api.servlets.ServletResolverservletResolver-
Fields inherited from class org.apache.sling.servlethelpers.internalrequests.InternalRequest
contentType, DEFAULT_METHOD, extension, log, MDC_KEY, path, requestMethod, resourceResolver, selectorString
-
-
Constructor Summary
Constructors Constructor Description ServletInternalRequest(@NotNull org.apache.sling.api.servlets.ServletResolver servletResolver, @NotNull org.apache.sling.api.resource.Resource resource)Setup an internal request to the supplied Resource, using the supplied servlet/script resolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddelegateExecute(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, org.apache.sling.api.resource.ResourceResolver resourceResolver)Execute the supplied Requestprotected org.apache.sling.api.resource.ResourcegetExecutionResource()Provide the Resource to use to execute the requestStringtoString()Return essential request info, used to set the logging MDC-
Methods inherited from class org.apache.sling.servlethelpers.internalrequests.InternalRequest
assertRequestExecuted, checkNotNull, checkNotNull, checkResponseContentType, checkStatus, execute, getResponse, getResponseAsString, getStatus, withBody, withContentType, withExtension, withParameter, withParameters, withRequestMethod, withSelectors
-
-
-
-
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
-
getExecutionResource
protected org.apache.sling.api.resource.Resource getExecutionResource()
Description copied from class:InternalRequestProvide the Resource to use to execute the request- Specified by:
getExecutionResourcein classInternalRequest
-
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, IOExceptionDescription copied from class:InternalRequestExecute the supplied Request- Specified by:
delegateExecutein classInternalRequest- Throws:
javax.servlet.ServletExceptionIOException
-
-