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)Called by the servlet container to allow the servlet to respond to a request.- 
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
Description copied from class:GenericServletCalled by the servlet container to allow the servlet to respond to a request. SeeServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse).This method is declared abstract so subclasses, such as
HttpServlet, must override it.- Specified by:
 servicein interfaceServlet- Specified by:
 servicein classGenericServlet- Parameters:
 request- theServletRequestobject that contains the client's requestres- theServletResponseobject that will contain the servlet's response- Throws:
 ServletException- if an exception occurs that interferes with the servlet's normal operation occurredjava.io.IOException- if an input or output exception occurs
 
 - 
 
 -