Note: this component is designated "advanced", which means that objects of this type are not expected to be created or altered in most environments. If you believe that such a change is necessary, you may want to contact UnboundID support in order to understand the potential impact of that change.
The Velocity HTTP Servlet Extension may be used to present pages over HTTP rendered using the Apache Velocity template system.
Velocity templates are obtained from the filesystem via a loader instance which is selected for each request based on the request's Accept header and whether or not the loader has access to a resource that can fulfill the requested page.
Before a template is used to render content, a context is created containing content that can be referred to in templates via the Velocity variable syntax. You can expose a number of built-in context objects such as the HTTP response, request or session attributes using the properties of this Velocity HTTP Servlet Extension. You can also specify custom objects by creating Velocity Context Objects.
In addition to template-generated content, the Velocity HTTP Servlet Extension can be used to serve static content such as images, CSS and Javascript files.
↓Parent Component
↓Relations To this Component
↓Properties
↓dsconfig Usage
The Velocity HTTP Servlet Extension component inherits from the HTTP Servlet Extension
The following components have a direct composition relation from Velocity HTTP Servlet Extensions:
The properties supported by this managed object are as follows:
Basic Properties: | Advanced Properties: |
---|---|
↓ description | None |
↓ base-context-path | |
↓ static-context-path | |
↓ static-content-directory | |
↓ template-directory | |
↓ expose-request-attributes | |
↓ expose-session-attributes | |
↓ expose-server-context | |
↓ allow-context-override | |
↓ mime-types-file | |
↓ default-mime-type |
Description | A description for this HTTP Servlet Extension |
Default Value | None |
Allowed Values | A string |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | The context path to use to access all template-based and static content. The value must start with a forward slash and must represent a valid HTTP context path. |
Default Value | /view |
Allowed Values | The value must start with a forward slash and must represent a valid HTTP context path. |
Multi-Valued | No |
Required | Yes |
Admin Action Required | None. Modification requires no further action |
Description | The path below the base context path by which static, non-template content such as images, CSS, and Javascript files are accessible. |
Default Value | statics |
Allowed Values | A string |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | Specifies the base directory in which static, non-template content such as images, CSS, and Javascript files are stored on the filesystem. |
Default Value | config/velocity/statics |
Allowed Values | Unknown |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | Specifies the base directory in which template files are stored on the filesystem. This directory serves as the default directory for templates but can be overridden per loader instance by setting the corresponding template-directory property of the Velocity Template Loader instance. |
Default Value | config/velocity/templates |
Allowed Values | Unknown |
Multi-Valued | No |
Required | Yes |
Admin Action Required | None. Modification requires no further action |
Description | Specifies whether the HTTP request will be exposed to templates. If true the HTTP request will be included in the context as accessible via the 'ubid_request' attribute. |
Default Value | true |
Allowed Values | true false |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | Specifies whether the HTTP session will be exposed to templates. If true and the HTTP session exists for the current request, it will be included in the context as accessible via the 'ubid_session' attribute. |
Default Value | true |
Allowed Values | true false |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | Specifies whether a server context will be exposed under context key 'ubid_server' for all template contexts. Refer to the server SDK's API documentation for the com.unboundid.directory.sdk.common.types.ServerContext class for more information about the properties and methods made available by the server context. |
Default Value | true |
Allowed Values | true false |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | Indicates whether context providers may override existing context objects with new values. If 'true' context providers may set the value of any non-protected context key, possibly overriding a value previously set by a provider. If 'false' an attempt made to override a context value will cause a runtime exception. |
Default Value | false |
Allowed Values | true false |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | Specifies the path to a file that contains MIME type mappings that will be used to determine the appropriate value to return for the Content-Type header based on the extension of the requested static content file. If a MIME types file is specified, then it may take one of two forms: it may either use the de-facto standard form in which the MIME type is followed by one or more spaces or tabs, which are then followed by a list of space and/or tab-delimited file extensions (e.g., "text/html html htm" indicates that any file with an extension of "html" or "htm" should have a Content-Type value of "text/html"), or it may use a Java properties file format in which an extension should be followed by an equal sign and the MIME type for that extension (e.g., "html=text/html" indicates that a Content-Type value of "text/html" should be used for files with an extension of "html". Note that even if the properties file format is used, line wrapping is not supported so each definition must be given on one line. |
Default Value | A default set of MIME type definitions will be used. |
Allowed Values | Unknown |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
Description | Specifies a the default value that will be used in the response's Content-Type header that indicates the type of content to return. This property may be overridden per template loader by setting the corresponding mime-type property of the Velocity Template Loader objects. Common media types are 'text/html', 'application/xml', and 'application/json'. |
Default Value | text/html |
Allowed Values | The value must represent a valid Internet media type consisting of a type, subtype. Optional parameters are not permitted. |
Multi-Valued | No |
Required | No |
Admin Action Required | None. Modification requires no further action |
To list the configured HTTP Servlet Extensions:
dsconfig list-http-servlet-extensions [--property {propertyName}] ...
To view the configuration for an existing HTTP Servlet Extension:
dsconfig get-http-servlet-extension-prop --extension-name {name} [--tab-delimited] [--script-friendly] [--property {propertyName}] ...
To update the configuration for an existing HTTP Servlet Extension:
dsconfig set-http-servlet-extension-prop --extension-name {name} (--set|--add|--remove) {propertyName}:{propertyValue} [(--set|--add|--remove) {propertyName}:{propertyValue}] ...
To create a new Velocity HTTP Servlet Extension:
dsconfig create-http-servlet-extension --extension-name {name} --type velocity [--set {propertyName}:{propertyValue}] ...
To delete an existing HTTP Servlet Extension:
dsconfig delete-http-servlet-extension --extension-name {name}