Class SlingConstants
- java.lang.Object
-
- org.apache.sling.api.SlingConstants
-
public class SlingConstants extends java.lang.ObjectTheSlingConstantsinterface provides some symbolic constants for well known constant strings in Sling. Even though these constants will never change, it is recommended that applications refer to the symbolic constants instead of code the strings themselves.This class is not intended to be extended or instantiated because it just provides constants not intended to be overwritten.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTR_INCLUDE_CONTEXT_PATHThe name of the request attribute containing theHttpServletRequest.getContextPath()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.context_path").static java.lang.StringATTR_INCLUDE_PATH_INFOThe name of the request attribute containing theHttpServletRequest.getPathInfo()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.path_info").static java.lang.StringATTR_INCLUDE_QUERY_STRINGThe name of the request attribute containing theHttpServletRequest.getQueryString()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.query_string").static java.lang.StringATTR_INCLUDE_REQUEST_URIThe name of the request attribute containing theHttpServletRequest.getRequestURI()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.request_uri").static java.lang.StringATTR_INCLUDE_SERVLET_PATHThe name of the request attribute containing theHttpServletRequest.getServletPath()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.servlet_path").static java.lang.StringATTR_REQUEST_CONTENTThe name of the request attribute containing theResourceunderlying theServletwhich included the servlet currently being active (value is "org.apache.sling.api.include.resource").static java.lang.StringATTR_REQUEST_PATH_INFOThe name of the request attribute containing theRequestPathInfounderlying theServletwhich included the servlet currently being active (value is "org.apache.sling.api.include.request_path_info").static java.lang.StringATTR_REQUEST_SERVLETThe name of the request attribute containing theServletwhich included the servlet currently being active (value is "org.apache.sling.api.include.servlet").static java.lang.StringERROR_EXCEPTIONThe name of the request attribute containing the exception thrown causing the error handler to be called (value is "javax.servlet.error.exception").static java.lang.StringERROR_EXCEPTION_TYPEThe name of the request attribute containing the fully qualified class name of the exception thrown causing the error handler to be called (value is "javax.servlet.error.exception_type").static java.lang.StringERROR_MESSAGEThe name of the request attribute containing the message of the error situation (value is "javax.servlet.error.message").static java.lang.StringERROR_REQUEST_URIThe name of the request attribute containing the URL requested by the client during whose processing the error handling was caused (value is "javax.servlet.error.request_uri").static java.lang.StringERROR_SERVLET_NAMEThe name of the request attribute containing the name of the servlet which caused the error handling (value is "javax.servlet.error.servlet_name").static java.lang.StringERROR_STATUSThe name of the request attribute containing the status code sent to the client (value is "javax.servlet.error.status_code").static java.lang.StringNAMESPACE_PREFIXThe namespace prefix used throughout Sling (value is "sling").static java.lang.StringNAMESPACE_URI_ROOTThe namespace URI prefix to be used by Sling projects to define namespaces (value is "http://sling.apache.org/").static java.lang.StringPROPERTY_ADAPTABLE_CLASSESDeprecated.Use a service listener listening for service removed events fororg.apache.sling.adapter.Adaption.static java.lang.StringPROPERTY_ADAPTER_CLASSESDeprecated.Use a service listener listening for service removed events fororg.apache.sling.adapter.Adaption.static java.lang.StringPROPERTY_ADDED_ATTRIBUTESThe name of the event property holding the added attribute names of a resource for anTOPIC_RESOURCE_CHANGEDevent.static java.lang.StringPROPERTY_CHANGED_ATTRIBUTESThe name of the event property holding the changed attribute names of a resource for anTOPIC_RESOURCE_CHANGEDevent.static java.lang.StringPROPERTY_PATHThe name of the event property holding the resource path.static java.lang.StringPROPERTY_REMOVED_ATTRIBUTESThe name of the event property holding the removed attribute names of a resource for anTOPIC_RESOURCE_CHANGEDevent.static java.lang.StringPROPERTY_RESOURCE_SUPER_TYPEThe name of the event property holding the resource super type.static java.lang.StringPROPERTY_RESOURCE_TYPEThe name of the event property holding the resource type.static java.lang.StringPROPERTY_USERIDThe name of the event property holding the userid.static java.lang.StringSLING_CURRENT_SERVLET_NAMEThe name of the request attribute providing the name of the currently executing servlet (value is "sling.core.current.servletName").static java.lang.StringTOPIC_ADAPTER_FACTORY_ADDEDDeprecated.Use a service listener listening for service removed events fororg.apache.sling.adapter.Adaption.static java.lang.StringTOPIC_ADAPTER_FACTORY_REMOVEDDeprecated.Use a service listener listening for service removed events fororg.apache.sling.adapter.Adaption.static java.lang.StringTOPIC_RESOURCE_ADDEDDeprecated.Register aResourceChangeListenerinsteadstatic java.lang.StringTOPIC_RESOURCE_CHANGEDDeprecated.Register aResourceChangeListenerinsteadstatic java.lang.StringTOPIC_RESOURCE_PROVIDER_ADDEDThe topic for the OSGi event which is sent when a resource provider has been added to the resource tree.static java.lang.StringTOPIC_RESOURCE_PROVIDER_REMOVEDThe topic for the OSGi event which is sent when a resource provider has been removed from the resource tree.static java.lang.StringTOPIC_RESOURCE_REMOVEDDeprecated.Register aResourceChangeListenerinsteadstatic java.lang.StringTOPIC_RESOURCE_RESOLVER_MAPPING_CHANGEDThe topic for the OSGi event which is sent when the resource mapping changes.
-
Constructor Summary
Constructors Constructor Description SlingConstants()
-
-
-
Field Detail
-
NAMESPACE_PREFIX
public static final java.lang.String NAMESPACE_PREFIX
The namespace prefix used throughout Sling (value is "sling").The actual use depends on the environment. For example a
ResourceResolverusing a JCR repository may name Sling node types and items using namespaces mapped to this prefix. A JSP tag library for Sling may use this prefix as the namespace prefix for its tags.- See Also:
- Constant Field Values
-
NAMESPACE_URI_ROOT
public static final java.lang.String NAMESPACE_URI_ROOT
The namespace URI prefix to be used by Sling projects to define namespaces (value is "http://sling.apache.org/").The actual namespace URI depends on the environment. For example a
ResourceResolverusing a JCR repository may define its namespace asNAMESPACE_URI_ROOT + "jcr/sling/1.0". A JSP tag library for Sling may define its namespace asNAMESPACE_URI_ROOT + "taglib/sling/1.0".- See Also:
- Constant Field Values
-
ATTR_REQUEST_SERVLET
public static final java.lang.String ATTR_REQUEST_SERVLET
The name of the request attribute containing theServletwhich included the servlet currently being active (value is "org.apache.sling.api.include.servlet"). This attribute is only set if the serlvet or script is included viaRequestDispatcher.includefrom another servlet or script.The type of the attribute value is
javax.servlet.Servlet.- See Also:
- Constant Field Values
-
ATTR_REQUEST_CONTENT
public static final java.lang.String ATTR_REQUEST_CONTENT
The name of the request attribute containing theResourceunderlying theServletwhich included the servlet currently being active (value is "org.apache.sling.api.include.resource"). This attribute is only set if the serlvet or script is included viaRequestDispatcher.includefrom another servlet or script.The type of the attribute value is
org.apache.sling.api.resource.Resource.- See Also:
- Constant Field Values
-
ATTR_REQUEST_PATH_INFO
public static final java.lang.String ATTR_REQUEST_PATH_INFO
The name of the request attribute containing theRequestPathInfounderlying theServletwhich included the servlet currently being active (value is "org.apache.sling.api.include.request_path_info"). This attribute is only set if the serlvet or script is included viaRequestDispatcher.includefrom another servlet or script.The type of the attribute value is
org.apache.sling.api.request.RequestPathInfo.- See Also:
- Constant Field Values
-
ATTR_INCLUDE_REQUEST_URI
public static final java.lang.String ATTR_INCLUDE_REQUEST_URI
The name of the request attribute containing theHttpServletRequest.getRequestURI()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.request_uri"). This attribute is only set if the serlvet or script is included viaRequestDispatcher.includefrom another servlet or script.The type of the attribute value is
String.Note: In Sling, the
HttpServletRequest.getRequestURI()method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification.- See Also:
- Constant Field Values
-
ATTR_INCLUDE_CONTEXT_PATH
public static final java.lang.String ATTR_INCLUDE_CONTEXT_PATH
The name of the request attribute containing theHttpServletRequest.getContextPath()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.context_path"). This attribute is only set if the serlvet or script is included viaRequestDispatcher.includefrom another servlet or script.The type of the attribute value is
String.Note: In Sling, the
HttpServletRequest.getContextPath()method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification.- See Also:
- Constant Field Values
-
ATTR_INCLUDE_SERVLET_PATH
public static final java.lang.String ATTR_INCLUDE_SERVLET_PATH
The name of the request attribute containing theHttpServletRequest.getServletPath()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.servlet_path"). This attribute is only set if the serlvet or script is included viaRequestDispatcher.includefrom another servlet or script.The type of the attribute value is
String.Note: In Sling, the
HttpServletRequest.getServletPath()method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification.- See Also:
- Constant Field Values
-
ATTR_INCLUDE_PATH_INFO
public static final java.lang.String ATTR_INCLUDE_PATH_INFO
The name of the request attribute containing theHttpServletRequest.getPathInfo()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.path_info"). This attribute is only set if the serlvet or script is included viaRequestDispatcher.includefrom another servlet or script.The type of the attribute value is
String.Note: In Sling, the
HttpServletRequest.getPathInfo()method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification.- See Also:
- Constant Field Values
-
ATTR_INCLUDE_QUERY_STRING
public static final java.lang.String ATTR_INCLUDE_QUERY_STRING
The name of the request attribute containing theHttpServletRequest.getQueryString()of the request which included the servlet currently being active underlying theServletwhich included the servlet currently being active (value is "javax.servlet.include.query_string"). This attribute is only set if the serlvet or script is included viaRequestDispatcher.includefrom another servlet or script.The type of the attribute value is
String.Note: In Sling, the
HttpServletRequest.getQueryString()method will always return the same result regardless of whether it is called from the client request processing servlet or script or from an included servlet or script. This request attribute is set for compatibility with the Servlet API specification.- See Also:
- Constant Field Values
-
ERROR_EXCEPTION
public static final java.lang.String ERROR_EXCEPTION
The name of the request attribute containing the exception thrown causing the error handler to be called (value is "javax.servlet.error.exception"). This attribute is only available to error handling servlets and only if an exception has been thrown causing error handling.The type of the attribute value is
java.lang.Throwable.- See Also:
- Constant Field Values
-
ERROR_EXCEPTION_TYPE
public static final java.lang.String ERROR_EXCEPTION_TYPE
The name of the request attribute containing the fully qualified class name of the exception thrown causing the error handler to be called (value is "javax.servlet.error.exception_type"). This attribute is only available to error handling servlets and only if an exception has been thrown causing error handling. This attribute is present for backwards compatibility only. Error handling servlet implementors are advised to use theThrowableitself.The type of the attribute value is
java.lang.String.- See Also:
- Constant Field Values
-
ERROR_MESSAGE
public static final java.lang.String ERROR_MESSAGE
The name of the request attribute containing the message of the error situation (value is "javax.servlet.error.message"). If an exception caused error handling, this is the exceptions message fromThrowable.getMessage(). If error handling is caused by a call to one of theSlingHttpServletResponse.sendErrormethods, this attribute contains the optional message.The type of the attribute value is
java.lang.String.- See Also:
- Constant Field Values
-
ERROR_REQUEST_URI
public static final java.lang.String ERROR_REQUEST_URI
The name of the request attribute containing the URL requested by the client during whose processing the error handling was caused (value is "javax.servlet.error.request_uri"). This property is retrieved calling theSlingHttpServletRequest.getRequestURI()method.The type of the attribute value is
java.lang.String.- See Also:
- Constant Field Values
-
ERROR_SERVLET_NAME
public static final java.lang.String ERROR_SERVLET_NAME
The name of the request attribute containing the name of the servlet which caused the error handling (value is "javax.servlet.error.servlet_name").The type of the attribute value is
java.lang.String.- See Also:
- Constant Field Values
-
ERROR_STATUS
public static final java.lang.String ERROR_STATUS
The name of the request attribute containing the status code sent to the client (value is "javax.servlet.error.status_code"). Error handling servlets may set this status code on their response to the client or they may choose to set another status code. For example a handler for NOT_FOUND status (404) may opt to redirect to a new location and thus not set the 404 status but a MOVED_PERMANENTLY (301) status. If this attribute is not set and the error handler is not configured to set its own status code anyway, a default value of INTERNAL_SERVER_ERROR (500) should be sent.The type of the attribute value is
java.lang.Integer.- See Also:
- Constant Field Values
-
TOPIC_RESOURCE_ADDED
@Deprecated public static final java.lang.String TOPIC_RESOURCE_ADDED
Deprecated.Register aResourceChangeListenerinsteadThe topic for the OSGi event which is sent when a resource has been added to the resource tree. The event contains at least thePROPERTY_PATH,PROPERTY_RESOURCE_SUPER_TYPEandPROPERTY_RESOURCE_TYPEproperties.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
TOPIC_RESOURCE_REMOVED
@Deprecated public static final java.lang.String TOPIC_RESOURCE_REMOVED
Deprecated.Register aResourceChangeListenerinsteadThe topic for the OSGi event which is sent when a resource has been removed from the resource tree. The event contains at least thePROPERTY_PATH. As the resource has already been removed no further information like resource type etc. might be available.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
TOPIC_RESOURCE_CHANGED
@Deprecated public static final java.lang.String TOPIC_RESOURCE_CHANGED
Deprecated.Register aResourceChangeListenerinsteadThe topic for the OSGi event which is sent when a resource has been changed in the resource tree. The event contains at least thePROPERTY_PATH,PROPERTY_RESOURCE_SUPER_TYPEandPROPERTY_RESOURCE_TYPEproperties. Since 2.2.0 the event might contain these propertiesPROPERTY_ADDED_ATTRIBUTES,PROPERTY_REMOVED_ATTRIBUTES,PROPERTY_CHANGED_ATTRIBUTES. All of them are optional.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
TOPIC_RESOURCE_PROVIDER_ADDED
public static final java.lang.String TOPIC_RESOURCE_PROVIDER_ADDED
The topic for the OSGi event which is sent when a resource provider has been added to the resource tree. The event contains at least thePROPERTY_PATHproperty.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
TOPIC_RESOURCE_PROVIDER_REMOVED
public static final java.lang.String TOPIC_RESOURCE_PROVIDER_REMOVED
The topic for the OSGi event which is sent when a resource provider has been removed from the resource tree. The event contains at least thePROPERTY_PATHproperty.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
TOPIC_RESOURCE_RESOLVER_MAPPING_CHANGED
public static final java.lang.String TOPIC_RESOURCE_RESOLVER_MAPPING_CHANGED
The topic for the OSGi event which is sent when the resource mapping changes.- Since:
- 2.2.0 (Sling API Bundle 2.2.0)
- See Also:
- Constant Field Values
-
PROPERTY_PATH
public static final java.lang.String PROPERTY_PATH
The name of the event property holding the resource path.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
PROPERTY_USERID
public static final java.lang.String PROPERTY_USERID
The name of the event property holding the userid. This property is optional.- Since:
- 2.1.0 (Sling API Bundle 2.1.0)
- See Also:
- Constant Field Values
-
PROPERTY_RESOURCE_TYPE
public static final java.lang.String PROPERTY_RESOURCE_TYPE
The name of the event property holding the resource type.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
PROPERTY_RESOURCE_SUPER_TYPE
public static final java.lang.String PROPERTY_RESOURCE_SUPER_TYPE
The name of the event property holding the resource super type.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
PROPERTY_CHANGED_ATTRIBUTES
public static final java.lang.String PROPERTY_CHANGED_ATTRIBUTES
The name of the event property holding the changed attribute names of a resource for anTOPIC_RESOURCE_CHANGEDevent. The value of the property is a string array.- Since:
- 2.2.0 (Sling API Bundle 2.2.0)
- See Also:
- Constant Field Values
-
PROPERTY_ADDED_ATTRIBUTES
public static final java.lang.String PROPERTY_ADDED_ATTRIBUTES
The name of the event property holding the added attribute names of a resource for anTOPIC_RESOURCE_CHANGEDevent. The value of the property is a string array.- Since:
- 2.2.0 (Sling API Bundle 2.2.0)
- See Also:
- Constant Field Values
-
PROPERTY_REMOVED_ATTRIBUTES
public static final java.lang.String PROPERTY_REMOVED_ATTRIBUTES
The name of the event property holding the removed attribute names of a resource for anTOPIC_RESOURCE_CHANGEDevent. The value of the property is a string array.- Since:
- 2.2.0 (Sling API Bundle 2.2.0)
- See Also:
- Constant Field Values
-
TOPIC_ADAPTER_FACTORY_ADDED
@Deprecated public static final java.lang.String TOPIC_ADAPTER_FACTORY_ADDED
Deprecated.Use a service listener listening for service removed events fororg.apache.sling.adapter.Adaption.The topic for the OSGi event which is sent when an adapter factory has been added. The event contains at least thePROPERTY_ADAPTABLE_CLASSES, andPROPERTY_ADAPTER_CLASSESpoperties.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
TOPIC_ADAPTER_FACTORY_REMOVED
@Deprecated public static final java.lang.String TOPIC_ADAPTER_FACTORY_REMOVED
Deprecated.Use a service listener listening for service removed events fororg.apache.sling.adapter.Adaption.The topic for the OSGi event which is sent when an adapter factory has been removed. The event contains at least thePROPERTY_ADAPTABLE_CLASSES, andPROPERTY_ADAPTER_CLASSESpoperties.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
PROPERTY_ADAPTABLE_CLASSES
public static final java.lang.String PROPERTY_ADAPTABLE_CLASSES
Deprecated.Use a service listener listening for service removed events fororg.apache.sling.adapter.Adaption.The event property listing the fully qualified names of classes which can be adapted by this adapter factory (value is "adaptables"). The type of the value is a string array.- Since:
- 2.0.6 (Sling API Bundle 2.0.6)
- See Also:
- Constant Field Values
-
PROPERTY_ADAPTER_CLASSES
public static final java.lang.String PROPERTY_ADAPTER_CLASSES
Deprecated.Use a service listener listening for service removed events fororg.apache.sling.adapter.Adaption.The event property listing the fully qualified names of classes to which this factory can adapt adaptables (value is "adapters"). The type of the value is a string array.- See Also:
- Constant Field Values
-
SLING_CURRENT_SERVLET_NAME
public static final java.lang.String SLING_CURRENT_SERVLET_NAME
The name of the request attribute providing the name of the currently executing servlet (value is "sling.core.current.servletName"). This attribute is set immediately before calling theServlet.service()method and reset to any previously stored value after the service method returns.- Since:
- 2.1 (Sling API Bundle 2.1.0)
- See Also:
- Constant Field Values
-
-