Class ServletResolverConstants

java.lang.Object
org.apache.sling.api.servlets.ServletResolverConstants

public final class ServletResolverConstants extends Object
Service registration properties and common values used for registering a Sling Servlet.
Since:
2.2.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The HTTP "method" name of an error handler used as the default (value is "default").
    static final String
    The resource type used to select error handlers (value is "sling/servlet/errorhandler").
    static final String
    The resource type of a registered servlet used as the default servlet if no other (more specific) servlet or script could be selected (value is "sling/servlet/default").
    static final String
    The name of the service registration property of a servlet registered as a service containing the request URL extensions supported by the servlet for GET requests (value is "sling.servlet.extensions").
    static final String
    The name of the service registration property of a servlet registered as a service containing the request methods supported by the servlet (value is "sling.servlet.methods").
    static final String
    The name of the service registration property of a Servlet registered as a service containing the name of the servlet (value is "sling.core.servletName").
    static final String
    The name of the service registration property of a servlet registered as a service providing the absolute paths under which the servlet is accessible as a resource (value is "sling.servlet.paths").
    static final String
    The name of the service registration property of a servlet registered as a service providing the prefix/index to be used to register this servlet.
    static final String
    The name of the service registration property of a servlet registered as a service containing the resource super type supported by the servlet (value is "sling.servlet.resourceSuperType").
    static final String
    The name of the service registration property of a servlet registered as a service containing the resource type(s) supported by the servlet (value is "sling.servlet.resourceTypes").
    static final String
    The name of the service registration property of a Servlet registered as a service containing the request URL selectors supported by the servlet (value is "sling.servlet.selectors").
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SLING_SERVLET_PATHS

      public static final String SLING_SERVLET_PATHS
      The name of the service registration property of a servlet registered as a service providing the absolute paths under which the servlet is accessible as a resource (value is "sling.servlet.paths"). A relative path is made absolute by prefixing it with the value set through the SLING_SERVLET_PREFIX property.

      The type of this property is a String or String[] (array of strings) denoting the path(s) under which the servlet is registered in the resource tree.

      Either this property or the SLING_SERVLET_RESOURCE_TYPES property must be set or the servlet is ignored. If both are set the servlet is registered using both ways.

      A servlet using this property might be ignored unless its path is included in the Execution Paths servletresolver.paths configuration setting of the org.apache.sling.servlets.resolver.internal.SlingServletResolver service.

      See Also:
    • SLING_SERVLET_RESOURCE_TYPES

      public static final String SLING_SERVLET_RESOURCE_TYPES
      The name of the service registration property of a servlet registered as a service containing the resource type(s) supported by the servlet (value is "sling.servlet.resourceTypes"). A relative resource type is made absolute by prefixing it with the value set through the SLING_SERVLET_PREFIX property.

      The type of this property is a String or String[] (array of strings) denoting the resource types.

      Either this property or the SLING_SERVLET_PATHS property must be set, or the servlet is ignored. If both are set, the servlet is registered using both ways.

      See Also:
    • SLING_SERVLET_RESOURCE_SUPER_TYPE

      public static final String SLING_SERVLET_RESOURCE_SUPER_TYPE
      The name of the service registration property of a servlet registered as a service containing the resource super type supported by the servlet (value is "sling.servlet.resourceSuperType").

      The type of this property is a String denoting the resource super type. This property is ignored if the SLING_SERVLET_RESOURCE_TYPES property is not set. Otherwise this property is optional and ignored if not set.

      See Also:
    • SLING_SERVLET_PREFIX

      public static final String SLING_SERVLET_PREFIX

      The name of the service registration property of a servlet registered as a service providing the prefix/index to be used to register this servlet. It only is applied as prefix to SLING_SERVLET_PATHS and SLING_SERVLET_RESOURCE_TYPES in case they do not start with a "/".

      • If the value of this property is a number, it defines the index of the search path entries from the resource resolver. The defined search path is used as a prefix to mount this servlet. The number can be -1 which always points to the last search entry. If the specified value is higher than than the highest index of the search paths, the last entry is used. The index starts with 0. If the value of this property is a string and parseable as a number, the above logic is used.
      • If the value of this property is a string starting with "/", this value is applied as a prefix, regardless of the configured search paths!
      • If the value is anything else, it is ignored.
      If this property is not specified, the configuration of the org.apache.sling.servlets.resolver.internal.SlingServletResolver service is used. In case even that one is not set "/" is used as prefix.
      See Also:
    • SLING_SERVLET_SELECTORS

      public static final String SLING_SERVLET_SELECTORS
      The name of the service registration property of a Servlet registered as a service containing the request URL selectors supported by the servlet (value is "sling.servlet.selectors"). The selectors must be configured as they would be specified in the URL that is as a list of dot-separated strings such as print.a4.

      The type of this property is a String or String[] (array of strings) denoting the resource types. This property is ignored if the SLING_SERVLET_RESOURCE_TYPES property is not set. Otherwise this property is optional and ignored if not set.

      See Also:
    • SLING_SERVLET_EXTENSIONS

      public static final String SLING_SERVLET_EXTENSIONS
      The name of the service registration property of a servlet registered as a service containing the request URL extensions supported by the servlet for GET requests (value is "sling.servlet.extensions").

      The type of this property is a String or String[] (array of strings) denoting the resource types. This property is ignored if the SLING_SERVLET_RESOURCE_TYPES property is not set. Otherwise this property is optional and ignored if not set.

      See Also:
    • SLING_SERVLET_METHODS

      public static final String SLING_SERVLET_METHODS
      The name of the service registration property of a servlet registered as a service containing the request methods supported by the servlet (value is "sling.servlet.methods"). The value may be one of the HTTP methods or "*" for all methods.

      The type of this property is a String or String[] (array of strings) denoting the resource types. This property is ignored if the SLING_SERVLET_RESOURCE_TYPES property is not set. Otherwise this property is optional and assumed to be GET and HEAD if not set.

      See Also:
    • SLING_SERVLET_NAME

      public static final String SLING_SERVLET_NAME
      The name of the service registration property of a Servlet registered as a service containing the name of the servlet (value is "sling.core.servletName"). If this property is missing or empty, the component.name property or the service.pid is used. If none of the three properties is defined, the Servlet is ignored.
      See Also:
    • DEFAULT_RESOURCE_TYPE

      public static final String DEFAULT_RESOURCE_TYPE
      The resource type of a registered servlet used as the default servlet if no other (more specific) servlet or script could be selected (value is "sling/servlet/default"). If no servlet is registered under this name, the org.apache.sling.servlets.resolver.internal.defaults.DefaultServlet is used.
      See Also:
    • DEFAULT_ERROR_HANDLER_RESOURCE_TYPE

      public static final String DEFAULT_ERROR_HANDLER_RESOURCE_TYPE
      The resource type used to select error handlers (value is "sling/servlet/errorhandler").
      See Also:
    • DEFAULT_ERROR_HANDLER_METHOD

      public static final String DEFAULT_ERROR_HANDLER_METHOD
      The HTTP "method" name of an error handler used as the default (value is "default").
      See Also:
  • Constructor Details

    • ServletResolverConstants

      public ServletResolverConstants()