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,javax.servlet.Servlet,javax.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 javax.servlet.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(javax.servlet.ServletRequest request, javax.servlet.ServletResponse res)- 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log 
 - 
 
 - 
 
- 
- 
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(javax.servlet.ServletRequest request, javax.servlet.ServletResponse res) throws javax.servlet.ServletException, java.io.IOException- Specified by:
 servicein interfacejavax.servlet.Servlet- Specified by:
 servicein classjavax.servlet.GenericServlet- Throws:
 javax.servlet.ServletExceptionjava.io.IOException
 
 - 
 
 -