Annotation Type SlingServletResourceTypes


@ComponentPropertyType public @interface SlingServletResourceTypes
Component Property Type (as defined by OSGi DS 1.4) for Sling Servlets. Takes care of writing the relevant service properties as being used by the Sling Servlet Resolver (ServletResolverConstants) to register the annotated servlet component as Sling servlet for a specific resource type.
See Also:
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The resource type(s) supported by the servlet (value is "sling.servlet.resourceTypes").
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The request URL extensions supported by the servlet.
    The request methods supported by the servlet.
    The resource super type from which the servlet inherits (value is "sling.servlet.resourceSuperType").
    One ore more request URL selectors supported by the servlet.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Prefix for every property being generated from the annotations elements (as defined in OSGi 7 Compendium, 112.8.2.1)
  • Field Details

    • PREFIX_

      static final String PREFIX_
      Prefix for every property being generated from the annotations elements (as defined in OSGi 7 Compendium, 112.8.2.1)
      See Also:
  • Element Details

    • resourceTypes

      String[] resourceTypes
      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 SlingServletPrefix annotation.
      Returns:
      the resource type(s)
    • resourceSuperType

      String resourceSuperType
      The resource super type from which the servlet inherits (value is "sling.servlet.resourceSuperType"). The default value of this registration property is "sling/bundle/resource".

      In order for this property to be taken into consideration, the org.apache.sling.servlets.resolver bundle needs to be deployed on the system, version 2.5.0 or above.

      Returns:
      the resource super type
      See Also:
      Default:
      "sling/bundle/resource"
    • selectors

      String[] selectors
      One ore more request URL selectors supported by the servlet. The selectors must be configured in the order as they would be specified in the URL that is as a list of dot-separated strings such as print.a4. In case this is not empty the first selector(s) (i.e. the one on the left in the URL) must match, otherwise the servlet is not executed. After that may follow arbitrarily many non-registered selectors.
      Returns:
      the selector(s)
      See Also:
      Default:
      {}
    • extensions

      String[] extensions
      The request URL extensions supported by the servlet.

      It this is not set, the servlet is not limited to certain extensions.

      Returns:
      the extension(s)
      See Also:
      Default:
      {}
    • methods

      String[] methods
      The request methods supported by the servlet. The value may be one of the HTTP methods or "*" for all methods.

      If this is not set (i.e. empty array) it is assumed to be GET and HEAD.

      Returns:
      the methods(s)
      See Also:
      Default:
      {}