public abstract class AbstractPostServlet
extends org.apache.sling.api.servlets.SlingAllMethodsServlet
| Constructor and Description |
|---|
AbstractPostServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.sling.servlets.post.AbstractPostResponse |
createHtmlResponse(org.apache.sling.api.SlingHttpServletRequest req)
Creates an instance of a HtmlResponse.
|
protected void |
doPost(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse httpResponse) |
protected String |
externalizePath(org.apache.sling.api.SlingHttpServletRequest request,
String path)
Returns an external form of the given path prepending the context path
and appending a display extension.
|
protected String |
getItemPath(org.apache.sling.api.SlingHttpServletRequest request)
Returns the path of the resource of the request as the item path.
|
protected String |
getRedirectUrl(javax.servlet.http.HttpServletRequest request,
org.apache.sling.servlets.post.AbstractPostResponse ctx)
compute redirect URL (SLING-126)
|
protected abstract void |
handleOperation(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.servlets.post.AbstractPostResponse response,
List<org.apache.sling.servlets.post.Modification> changes)
Extending Servlet should implement this operation to do the work
|
protected boolean |
isSetStatus(org.apache.sling.api.SlingHttpServletRequest request) |
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayServicedoGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, serviceprotected void doPost(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse httpResponse)
throws javax.servlet.ServletException,
IOException
doPost in class org.apache.sling.api.servlets.SlingAllMethodsServletjavax.servlet.ServletExceptionIOExceptionprotected org.apache.sling.servlets.post.AbstractPostResponse createHtmlResponse(org.apache.sling.api.SlingHttpServletRequest req)
req - The request being servicedJSONResponse if any of these conditions are true:
HtmlResponse otherwiseprotected abstract void handleOperation(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.servlets.post.AbstractPostResponse response,
List<org.apache.sling.servlets.post.Modification> changes)
throws javax.jcr.RepositoryException
request - the sling http request to processresponse - the responsechanges - the changes to reportjavax.jcr.RepositoryException - in case of exceptions during the operationprotected String getRedirectUrl(javax.servlet.http.HttpServletRequest request, org.apache.sling.servlets.post.AbstractPostResponse ctx)
request - the requestctx - the post processornullprotected boolean isSetStatus(org.apache.sling.api.SlingHttpServletRequest request)
protected String getItemPath(org.apache.sling.api.SlingHttpServletRequest request)
This method may be overwritten by extension if the operation has different requirements on path processing.
request - the current requestprotected final String externalizePath(org.apache.sling.api.SlingHttpServletRequest request, String path)
request - the requestpath - the path to externalizeCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.