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


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

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


Optional Element Summary
 java.lang.String description
          This is generally used as a description for the object described by the meta type.
 java.lang.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".
 java.lang.String label
          This is generally used as a title for the object described by the meta type.
 boolean metatype
          Whether Metatype Service data is generated or not.
 java.lang.String[] methods
          One or more request methods supported by the servlet.
 java.lang.String name
          Defines the Component name also used as the PID for the Configuration Admin Service.
 java.lang.String[] paths
          One or more paths under which the servlet will be registered in the Sling Resource tree.
 java.lang.String[] resourceTypes
          One or more resource types which are handled by this servlet.
 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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:
{}

name

public abstract java.lang.String name
Defines the Component name also used as the PID for the Configuration Admin Service. Default value: Fully qualified name of the Java class.

Since:
1.6
Default:
""

metatype

public abstract boolean metatype
Whether Metatype Service data is generated or not. If this parameter is set to true Metatype Service data is generated in the metatype.xml file for this component. Otherwise no Metatype Service data is generated for this component.

Since:
1.6
Default:
false

label

public abstract java.lang.String label
This is generally used as a title for the object described by the meta type. This name may be localized by prepending a % sign to the name. Default value: %<name>.name

Since:
1.6
Default:
""

description

public abstract java.lang.String description
This is generally used as a description for the object described by the meta type. This name may be localized by prepending a % sign to the name. Default value: %<name>.description

Since:
1.6
Default:
""


Copyright © 2006-2012 The Apache Software Foundation. All Rights Reserved.