Class JakartaServletInternalRequest
java.lang.Object
org.apache.sling.servlethelpers.internalrequests.BaseInternalRequest
org.apache.sling.servlethelpers.internalrequests.JakartaInternalRequest
org.apache.sling.servlethelpers.internalrequests.JakartaServletInternalRequest
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.sling.api.servlets.ServletResolverFields inherited from class org.apache.sling.servlethelpers.internalrequests.BaseInternalRequest
bodyReader, contentType, DEFAULT_METHOD, explicitStatusCheck, extension, log, MDC_KEY, parameters, path, requestMethod, resourceResolver, selectorString -
Constructor Summary
ConstructorsConstructorDescriptionJakartaServletInternalRequest(@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
Modifier and TypeMethodDescriptionprotected voiddelegateExecute(org.apache.sling.api.SlingJakartaHttpServletRequest request, org.apache.sling.api.SlingJakartaHttpServletResponse response, org.apache.sling.api.resource.ResourceResolver resourceResolver) Execute the supplied Requestprotected org.apache.sling.api.resource.ResourceProvide the Resource to use to execute the requesttoString()Return essential request info, used to set the logging MDCMethods inherited from class org.apache.sling.servlethelpers.internalrequests.JakartaInternalRequest
assertRequestExecuted, checkResponseContentType, checkStatus, execute, getResponse, getResponseAsString, getStatus, withBody, withContentType, withExtension, withParameter, withParameters, withRequestMethod, withSelectorsMethods inherited from class org.apache.sling.servlethelpers.internalrequests.BaseInternalRequest
checkNotNull, checkNotNull
-
Field Details
-
servletResolver
protected final org.apache.sling.api.servlets.ServletResolver servletResolver
-
-
Constructor Details
-
JakartaServletInternalRequest
public JakartaServletInternalRequest(@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 Details
-
toString
Return essential request info, used to set the logging MDC -
getExecutionResource
protected org.apache.sling.api.resource.Resource getExecutionResource()Description copied from class:BaseInternalRequestProvide the Resource to use to execute the request- Specified by:
getExecutionResourcein classBaseInternalRequest
-
delegateExecute
protected void delegateExecute(org.apache.sling.api.SlingJakartaHttpServletRequest request, org.apache.sling.api.SlingJakartaHttpServletResponse response, org.apache.sling.api.resource.ResourceResolver resourceResolver) throws jakarta.servlet.ServletException, IOException Description copied from class:JakartaInternalRequestExecute the supplied Request- Specified by:
delegateExecutein classJakartaInternalRequest- Throws:
jakarta.servlet.ServletExceptionIOException
-