Annotation Type SlingServletFilter
-
@ComponentPropertyType public @interface SlingServletFilter
Component Property Type (as defined by OSGi DS 1.4) for Sling Servlet Filters. Takes care of writing the relevant service properties as being used by the Sling Servlet Resolver (ServletResolverConstants
) to register the annotated servlet filter component as Sling servlet filter.
The order of the filter is determined by the propertyservice.ranking
. To set it use the annotationServiceRanking
. Its value is used to sort the filters. Filters with a higher order are executed before a filter with a lower order. If two filters have the same order, the one with the lower service id is executed first.
Please note that the ordering is actually depending on the used Apache Sling Engine bundle version. Version older than 2.3.4 of that bundle are sorting the filters in the wrong reverse order. Make sure to run a newer version of the Sling engine to get the correct ordering (see also SLING-2920).- See Also:
- Felix SCR annotation, Sling Servlet Filter
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String[]
extensions
Restrict the filter to extensions that match request's.String[]
methods
Restrict the filter to methods that match request's.String
pattern
Restrict the filter to request paths that match the supplied regular expression.String[]
resourceTypes
Restrict the filter to resources that match any of the supplied resource types.SlingServletFilterScope[]
scope
The scopes of the filter.String[]
selectors
Restrict the filter to request selectors that match any of the request's.String
suffix_pattern
Restrict the filter to request suffixes that match the supplied regular expression.
-
-
-
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
-
scope
SlingServletFilterScope[] scope
The scopes of the filter. If the filter has request scope, it is run once for a request. If the filter has component scope, it is run once for every included component (rendering).- Returns:
- the scope of the filter
- Default:
- {org.apache.sling.servlets.annotations.SlingServletFilterScope.REQUEST}
-
-
-
pattern
String pattern
Restrict the filter to request paths that match the supplied regular expression. Empty value will not restrict the filter on request path. Requires Sling Engine 2.4.0.- Returns:
- the request path pattern to restrict the filter
- Default:
- ""
-
-
-
suffix_pattern
String suffix_pattern
Restrict the filter to request suffixes that match the supplied regular expression. Empty value will not restrict the filter on request suffix. Requires Sling Engine 2.7.0.- Returns:
- the suffix pattern to restrict the filter
- Default:
- ""
-
-
-
resourceTypes
String[] resourceTypes
Restrict the filter to resources that match any of the supplied resource types. Please note this is a sling resource APIisResourceType()
match, not a string match. Empty value will not restrict the filter on request's resource type. Requires Sling Engine 2.7.0.- Returns:
- the resourceTypes to restrict the filter
- Default:
- {}
-
-
-
methods
String[] methods
Restrict the filter to methods that match request's. Empty value will not restrict the filter on request method. Requires Sling Engine 2.7.0.- Returns:
- the methods to restrict the filter
- Default:
- {}
-
-
-
extensions
String[] extensions
Restrict the filter to extensions that match request's. Empty value will not restrict the filter on request extension. Requires Sling Engine 2.7.0.- Returns:
- the extensions to restrict the filter
- Default:
- {}
-
-
-
selectors
String[] selectors
Restrict the filter to request selectors that match any of the request's. At least one selector must match one of the provided selectors. Empty value will not restrict the filter on request selectors. Requires Sling Engine 2.7.0.- Returns:
- the selectors to restrict the filter
- Default:
- {}
-
-