@Service
public class MvcServlet
extends org.apache.sling.api.servlets.SlingAllMethodsServlet
dispatcher servlet. The first
BundleSpecificDispatcherServlet.hasHandlerFor(javax.servlet.http.HttpServletRequest) responsible servlet} wins.
If no servlet is responsible, a 404 response is returned.Enables
and disables MVC capabilities in bundles
via the injection of the BundleSpecificDispatcherServlet into the bean factory
of the bundles.BundleSpecificDispatcherServlet,
Serialized Form| Constructor and Description |
|---|
MvcServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
disableMvc(org.osgi.framework.Bundle bundle)
Removes the
BundleSpecificDispatcherServlet associated with the given bundle, if any. |
protected void |
doDelete(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response) |
protected void |
doGet(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response) |
protected void |
doHead(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response) |
protected void |
doOptions(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response) |
protected void |
doPost(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response) |
protected void |
doPut(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response) |
protected void |
doTrace(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response) |
void |
enableMvc(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory,
org.osgi.framework.BundleContext context)
Enables MVC capabilities in the given factory by injecting a
BundleSpecificDispatcherServlet. |
protected boolean |
mayService(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response) |
getAllowedRequestMethods, isMethodValiddoGeneric, getServletInfo, handleMethodNotImplemented, service, servicepublic void enableMvc(org.springframework.beans.factory.config.ConfigurableListableBeanFactory factory,
org.osgi.framework.BundleContext context)
BundleSpecificDispatcherServlet.factory - must not be null.context - must not be null.public void disableMvc(org.osgi.framework.Bundle bundle)
BundleSpecificDispatcherServlet associated with the given bundle, if any.bundle - must not be null.protected boolean mayService(@Nonnull org.apache.sling.api.SlingHttpServletRequest request, @Nonnull org.apache.sling.api.SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException
mayService in class org.apache.sling.api.servlets.SlingAllMethodsServletjavax.servlet.ServletExceptionIOExceptionprotected void doPost(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doPost in class org.apache.sling.api.servlets.SlingAllMethodsServletjavax.servlet.ServletExceptionIOExceptionprotected void doPut(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doPut in class org.apache.sling.api.servlets.SlingAllMethodsServletjavax.servlet.ServletExceptionIOExceptionprotected void doDelete(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doDelete in class org.apache.sling.api.servlets.SlingAllMethodsServletjavax.servlet.ServletExceptionIOExceptionprotected void doHead(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doHead in class org.apache.sling.api.servlets.SlingSafeMethodsServletjavax.servlet.ServletExceptionIOExceptionprotected void doGet(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doGet in class org.apache.sling.api.servlets.SlingSafeMethodsServletjavax.servlet.ServletExceptionIOExceptionprotected void doOptions(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doOptions in class org.apache.sling.api.servlets.SlingSafeMethodsServletjavax.servlet.ServletExceptionIOExceptionprotected void doTrace(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doTrace in class org.apache.sling.api.servlets.SlingSafeMethodsServletjavax.servlet.ServletExceptionIOExceptionCopyright © 2024. All rights reserved.