Package com.day.cq.commons.servlets
Class NonExistingDispatcherServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- com.day.cq.commons.servlets.NonExistingDispatcherServlet
-
- All Implemented Interfaces:
java.io.Serializable,Servlet,ServletConfig,OptingServlet
@SlingServlet(paths={"/apps/sling/nonexisting/GET.servlet","/apps/sling/nonexisting/POST.servlet","/apps/sling/nonexisting/PUT.servlet"}) @Reference(name="Servlet", referenceInterface=NonExistingResourceServlet.class, policy=DYNAMIC, cardinality=OPTIONAL_MULTIPLE) public class NonExistingDispatcherServlet extends GenericServlet implements OptingServletNonExistingDispatcherServlet is a solution to dispatch the sling:nonexisting resource type based on dynamic acceptance. With standard Sling it is only possible to register a single servlet for each HTTP method on the nonexisting resource.Please note: This is a temporary solution until Sling provides a built-in mechanism for this use case. Not to be used by client implementations!
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NonExistingDispatcherServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccepts(SlingHttpServletRequest request)Examines the request, and returntrueif this servlet is willing to handle the request.voidservice(ServletRequest request, ServletResponse res)-
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.servlet.Servlet
destroy, getServletConfig, getServletInfo, init
-
-
-
-
Method Detail
-
accepts
public boolean accepts(SlingHttpServletRequest request)
Description copied from interface:OptingServletExamines the request, and returntrueif this servlet is willing to handle the request. Iffalseis returned, the request will be ignored by this servlet, and may be handled by other servlets.- Specified by:
acceptsin interfaceOptingServlet- Parameters:
request- The request to examine- Returns:
trueif this servlet will handle the request,falseotherwise
-
service
public void service(ServletRequest request, ServletResponse res) throws ServletException, java.io.IOException
- Specified by:
servicein interfaceServlet- Specified by:
servicein classGenericServlet- Throws:
ServletExceptionjava.io.IOException
-
-