Class 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 OptingServlet
    NonExistingDispatcherServlet 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 Detail

      • NonExistingDispatcherServlet

        public NonExistingDispatcherServlet()
    • Method Detail

      • accepts

        public boolean accepts​(SlingHttpServletRequest request)
        Description copied from interface: OptingServlet
        Examines the request, and return true if this servlet is willing to handle the request. If false is returned, the request will be ignored by this servlet, and may be handled by other servlets.
        Specified by:
        accepts in interface OptingServlet
        Parameters:
        request - The request to examine
        Returns:
        true if this servlet will handle the request, false otherwise