Velocity Properties File Reference

Velocity Properties File Reference

The Velocity 2.0 templating engine is configured using a configuration file located at <InstallDir>/rxconfig/Server/velocity.properties.  

OptionDefault SettingDescription

runtime.conversion.handler.class

none

none: the only accepted conversions for method arguments will be the ones accepted by Java, typically widening number conversions. This reflects the behavior of Velocity 1.x.  Should not be changed.

space.gobbling

bc

Controls how whitespace is handled when templates are rendered.  Can be tuned based on Developer preference. Defaults to Velocity 1.x style rules.  For more information see the Velocity Developer page on Space Gobbling.

  • none: no space gobbling at all.
  • bc : Velocity 1.x backward compatible space gobbling.
  • lines : gobbles spaces and newline surrounding VTL directives alone in their line.
  • structured : like previous, plus fix inner text blocks indentation.

directive.if.emptycheck

false

When evaluating if a reference resolves to true or false in a boolean context, the engine first checks if its value is null, if it is a Boolean or if it has a getAsBoolean() method. Then, if none of this applies, the behavior depends upon this configuration flag.

When false:

no further check is performed and the object resolves to true.

When true:

  • return whether an array is empty.
  • return whether isEmpty() is false (covers String and all Collection classes).
  • return whether length() is zero (covers CharSequence classes other than String).
  • returns whether size() is zero (covers all Collections classes).
  • return whether a Number strictly equals zero.
  • return whether the result of getAsString() is empty (and false for a null result) if it exists.
  • return whether the result of getAsNumber() strictly equals zero (and false for a null result) if it exists.

 

input.encoding

UTF-8

Sets the encoding to UTF-8.  Should not be changed. 

velocimacro.permissions.allow.inline

trueDetermines of the definition of new Velocimacros via the #macro() directive in templates is allowed. The default value is true, meaning any template can define and use new Velocimacros. Note that depending on other properties, those #macro() statements can replace global definitions.

velocimacro.permissions.allow.inline.to.replace.global

trueControls if a Velocimacro defind 'inline' in a template can replace a Velocimacro defined in a library loaded at startup.

velocimacro.messages.on

true

velocimacro.permissions.allow.inline.local.scope

trueControls 'private' templates namespaces for Velocimacros. When true, a #macro() directive in a template creates a Velocimacro that is accessable only from the defining template. This means that Velocimacros cannot be shared unless they are in the global or local library loaded at startup. (See above.) It also means that templates cannot interfere with each other. This property also allows a technique where there is a 'default' Velocimacro definition in the global or local library, and a template can 'override' the implementation for use within that template. This occurrs because when this property is true, the template's namespace is searched for a Velocimacro before the global namespace, therefore allowing the override mechanism.

velocimacro.arguments.restore.previous

falseWhen false, Velocity Macro's will pass parameters in 1.x form, where variables passed as parameters are passed by reference regardless of name.   When true, Velocity 2.x style parameter passing will be used , where parameters are passed by name and by value.  Set to false by default for maximum backward compatibility.

Velocity supports a number of other configuration properties that can determine how the engine processes templates. A complete reference can be found on the Apache Velocity website.  When Percussion initializes the Velocity engine,  all properties in the velocity.properties file will be applied.