Package org.apache.sling.servlets.annotations

## 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:
  Sling Servlets, `ServletResolverConstants`, Felix SCR annotation

### Field Summary

Fields
`static String` `PREFIX_` Prefix for every property being generated from the annotations elements (as defined in OSGi 7 Compendium, 112.8.2.1)

### Required Element Summary

Required Elements
`String[]` `resourceTypes` The resource type(s) supported by the servlet (value is "sling.servlet.resourceTypes").

### Optional Element Summary

Optional Elements
`String[]` `extensions` The request URL extensions supported by the servlet.
`String[]` `methods` The request methods supported by the servlet.
`String` `resourceSuperType` The resource super type from which the servlet inherits (value is "sling.servlet.resourceSuperType").
`String[]` `selectors` One ore more request URL selectors supported by the servlet.

### Field Detail

#### 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)

### Element Detail

#### 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:
  `ServletResolverConstants.SLING_SERVLET_RESOURCE_SUPER_TYPE`, Apache Sling Resource Types

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:
  `ServletResolverConstants.SLING_SERVLET_SELECTORS`

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:
  `ServletResolverConstants.SLING_SERVLET_EXTENSIONS`

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:
  `ServletResolverConstants.SLING_SERVLET_METHODS`, HTTP 1.1 Spec Methods

Default:
  {}