Velocity context providers
Velocity Context Providers allow more flexibility when populating the Velocity Context for template use.
The previous examples use a value supplied as an HTTP request query string parameter to form a response. The templates contain a variable $ubid_request.parameters.name
that was replaced at runtime with a value from the Velocity Context.
The Velocity Extension can be configured to make some information available in the Velocity Context such as the HTTP request, session, and Server SDK Server Context.
Here are some of the properties of a Velocity Context Provider:
- enabled
-
Indicates whether the provider will contribute content for any requests.
- object-scope
-
Indicates to the provider how often objects contributed to the Velocity Context should be re-initialized. Possible values include
request
,session
, orapplication
. included-view
,excluded-view
-
These properties can be used to restrict the views for which a provider contributes content. A view name is the request URL’s path to the resource without the Velocity Servlet’s context or a leading forward slash. If one or more views are included, the provider will service requests for just the specified views. If one or more views are excluded, the provider will service requests for all but the excluded views.