|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
org.apache.sling.api.servlets.SlingSafeMethodsServlet
org.apache.sling.servlets.get.impl.RedirectServlet
public class RedirectServlet
The RedirectServlet
implements support for GET requests to
resources of type sling:redirect
. This servlet tries to get the
redirect target by
ValueMap
and trying to get the
property sling:target
.sling:target
below the requested resource and attapt this to a string.
If there is no value found for sling:target
a 404 (NOT FOUND)
status is sent by this servlet. Otherwise a 302 (FOUND, temporary redirect)
status is sent where the target is the relative URL from the current resource
to the target resource. Selectors, extension, suffix and query string are
also appended to the redirect URL.
Field Summary | |
---|---|
static int |
DEFAULT_JSON_RENDERER_MAXIMUM_RESULTS
Default value for the maximum amount of results that should be returned by the jsonResourceWriter |
static String |
JSON_RENDERER_MAXIMUM_RESULTS_PROPERTY
|
static String |
STATUS_PROP
The name of the redirect status property |
static String |
TARGET_PROP
The name of the target property |
Constructor Summary | |
---|---|
RedirectServlet()
|
Method Summary | |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext ctx)
|
protected void |
doGet(SlingHttpServletRequest request,
SlingHttpServletResponse response)
Called by the SlingSafeMethodsServlet.mayService(SlingHttpServletRequest, SlingHttpServletResponse) method to
handle an HTTP GET request. |
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet |
---|
doGeneric, doHead, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, init, init, log, log |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String TARGET_PROP
public static final String STATUS_PROP
public static final String JSON_RENDERER_MAXIMUM_RESULTS_PROPERTY
public static final int DEFAULT_JSON_RENDERER_MAXIMUM_RESULTS
Constructor Detail |
---|
public RedirectServlet()
Method Detail |
---|
protected void activate(org.osgi.service.component.ComponentContext ctx)
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException
SlingSafeMethodsServlet
SlingSafeMethodsServlet.mayService(SlingHttpServletRequest, SlingHttpServletResponse)
method to
handle an HTTP GET request.
This default implementation reports back to the client that the method is not supported.
Implementations of this class should overwrite this method with their implementation for the HTTP GET method support.
doGet
in class SlingSafeMethodsServlet
request
- The HTTP requestresponse
- The HTTP response
javax.servlet.ServletException
- Not thrown by this implementation.
IOException
- If the error status cannot be reported back to the
client.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |