org.apache.felix.scr.annotations.sling
Annotation Type SlingServlet


@Target(value=TYPE)
@Retention(value=SOURCE)
@Documented
public @interface SlingServlet

Marks servlet classes as SCR component, and allows to configure Sling's resource resolver mapping.


Optional Element Summary
 String[] extensions
          One or more request URL extensions supported by the servlet.
 boolean generateComponent
          Whether to generate a default SCR component tag.
 boolean generateService
          Whether to generate a default SCR service tag with "interface=javax.servlet.Servlet".
 String[] methods
          One or more request methods supported by the servlet.
 String[] paths
          One or more paths under which the servlet will be registered in the Sling Resource tree.
 String[] resourceTypes
          One or more resource types which are handled by this servlet.
 String[] selectors
          One ore more request URL selectors supported by the servlet.
 

generateComponent

public abstract boolean generateComponent
Whether to generate a default SCR component tag. If set to false, a Component annotation can be added manually with defined whatever configuration needed.

Default:
true

generateService

public abstract boolean generateService
Whether to generate a default SCR service tag with "interface=javax.servlet.Servlet". If set to false, a Service annotation can be added manually with defined whatever configuration needed.

Default:
true

paths

public abstract String[] paths
One or more paths under which the servlet will be registered in the Sling Resource tree.

This attribute is converted to values for the sling.servlet.paths property.

Note that to be used as a servlet for Sling either this attribute or the resourceTypes() attribute or both must be set.

Default:
{}

resourceTypes

public abstract String[] resourceTypes
One or more resource types which are handled by this servlet.

This attribute is converted to values for the sling.servlet.resourceTypes property.

Note that to be used as a servlet for Sling either this attribute or the paths() attribute or both must be set.

Default:
{}

selectors

public abstract String[] selectors
One ore more request URL selectors supported by the servlet. 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.

This attribute is converted to values for the sling.servlet.selectors property and is ignored if the resourceTypes() attribute is not set.

Default:
{}

extensions

public abstract String[] extensions
One or more request URL extensions supported by the servlet.

This attribute is converted to values for the sling.servlet.extensions property and is ignored if the resourceTypes() attribute is not set.

Default:
{}

methods

public abstract String[] methods
One or more request methods supported by the servlet.

This attribute is converted to values for the sling.servlet.methods property and is ignored if the resourceTypes() attribute is not set.

Default:
{}


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.