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.-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionString[]
The resource type(s) supported by the servlet (value is "sling.servlet.resourceTypes"). -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]
The request URL extensions supported by the servlet.String[]
The request methods supported by the servlet.The resource super type from which the servlet inherits (value is "sling.servlet.resourceSuperType").String[]
One ore more request URL selectors supported by the servlet. -
Field Summary
Fields
-
Field Details
-
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[] resourceTypesThe 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 theSlingServletPrefix
annotation.- Returns:
- the resource type(s)
-
-
-
resourceSuperType
String resourceSuperTypeThe 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[] selectorsOne 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[] extensionsThe 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[] methodsThe 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
andHEAD
.- Returns:
- the methods(s)
- See Also:
- Default:
- {}
-