Command "VelocityContextPut"

Summary

Adds an XML node, the content of a properties file or any other object to the velocity context The command belongs to the group "Velocity".


Parameters

Parameter Name Description Type
ContextName The name under which the object is added to the context. valueexpression
NodeRef An XML node which shall be added to the context. nodeReference
PropertiesFile The content of a properties file which shall be added to the context. Property values can then be accessed like $props.propertyX, $props.propertyY. valueexpression
Value A value calculated by an expression which shall be added to the context. valueexpression

Valid parameter combinations



Description

Adds an XML node, new properties of a properties file or a single value to the Velocity context specified.

Examples


Example 1

The example below adds the XML node "nodeToAdd" to the Velocity context "myContext".
<VelocityContextPut ContextName="myContext" NodeRef="$nodeToAdd"/>



Example 2

The example below adds the properties defined in "default.properties" to the Velocity context "myContext"./
<VelocityContextPut ContextName="myContext" PropertiesFile="default.properties">



Example 3

The example below adds the value "Server" to the velocity context.
<VelocityContextPut ContextName="myContext" Value="Server"/>