Common scripting variables
The basic objects, such as the request and response, are available for all scripting languages.
Name |
Description |
---|---|
request |
SlingHttpServletRequest object, providing access to the HTTP request header information - extends the standard HttpServletRequest - but also to Sling-specific things like resource, selectors, etc. |
response |
SlingHttpServletResponse object, providing access for the HTTP response that is created by the server. This is currently the same as the HttpServletResponse from which it extends. |
sling |
SlingScriptHelper, containing convenience methods for scripts, mainly |
resource |
Current Resource to handle, depending on the URL of the request. Same as |
currentNode |
If the current |
reader |
Direct access to the Reader of the request - same as |
out |
Direct access to the PrintWriter of the response - same as |
flush |
Indicates whether the output used by the script shall be flushed after the script evaluation ended. It is a Boolean, so use |
log |
Provides an SLF4J Logger for logging to the Sling log system from within scripts, eg. |
See also the api documentation of the org.apache.sling.api.scripting.SlingBindings.java which defines the common scripting variables.