public class SlingInternalRequest extends InternalRequest
ServletInternalRequest
which resolves and
calls a Servlet or Script directly.
This variant of internal requests is useful when no
Resource is available, as it builds its own Resource
based on the supplied parameters to drive the
Servlet/Script resolution mechanism.contentType, DEFAULT_METHOD, extension, log, MDC_KEY, path, requestMethod, resourceResolver, selectorString
Constructor and Description |
---|
SlingInternalRequest(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
@NotNull org.apache.sling.engine.SlingRequestProcessor p,
@NotNull java.lang.String path)
Setup an internal request that uses a SlingRequestProcessor
|
Modifier and Type | Method and Description |
---|---|
protected void |
delegateExecute(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
Execute the supplied Request
|
protected org.apache.sling.api.resource.Resource |
getExecutionResource()
Provide the Resource to use to execute the request
|
java.lang.String |
toString()
Return essential request info, used to set the logging MDC
|
SlingInternalRequest |
withResourceSuperType(java.lang.String resourceSuperType)
Sets the sling:resourceSuperType of the fake Resource used to resolve
the Script or Servlet used for the internal request
|
SlingInternalRequest |
withResourceType(java.lang.String resourceType)
Sets the sling:resourceType of the fake Resource used to resolve
the Script or Servlet used for the internal request
|
assertRequestExecuted, checkNotNull, checkNotNull, checkResponseContentType, checkStatus, execute, getResponse, getResponseAsString, getStatus, withBody, withContentType, withExtension, withParameter, withParameters, withRequestMethod, withSelectors
public SlingInternalRequest(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull @NotNull org.apache.sling.engine.SlingRequestProcessor p, @NotNull @NotNull java.lang.String path)
public java.lang.String toString()
toString
in class java.lang.Object
public SlingInternalRequest withResourceSuperType(java.lang.String resourceSuperType)
public SlingInternalRequest withResourceType(java.lang.String resourceType)
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, java.io.IOException
InternalRequest
delegateExecute
in class InternalRequest
javax.servlet.ServletException
java.io.IOException
protected org.apache.sling.api.resource.Resource getExecutionResource()
InternalRequest
getExecutionResource
in class InternalRequest
Copyright © 2014–2021 wcm.io. All rights reserved.