Modified: velocity/site/production/engine/devel/apidocs/org/apache/velocity/util/package-use.html URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/apidocs/org/apache/velocity/util/package-use.html?rev=1855189&r1=1855188&r2=1855189&view=diff ============================================================================== --- velocity/site/production/engine/devel/apidocs/org/apache/velocity/util/package-use.html (original) +++ velocity/site/production/engine/devel/apidocs/org/apache/velocity/util/package-use.html Mon Mar 11 00:49:33 2019 @@ -2,10 +2,10 @@ <!-- NewPage --> <html lang="en"> <head> -<!-- Generated by javadoc (1.8.0_191) on Wed Mar 06 16:10:21 CET 2019 --> +<!-- Generated by javadoc (1.8.0_191) on Mon Mar 11 01:36:32 CET 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Package org.apache.velocity.util (Apache Velocity 2.1-SNAPSHOT API)</title> -<meta name="date" content="2019-03-06"> +<meta name="date" content="2019-03-11"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head>
Modified: velocity/site/production/engine/devel/apidocs/overview-frame.html URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/apidocs/overview-frame.html?rev=1855189&r1=1855188&r2=1855189&view=diff ============================================================================== --- velocity/site/production/engine/devel/apidocs/overview-frame.html (original) +++ velocity/site/production/engine/devel/apidocs/overview-frame.html Mon Mar 11 00:49:33 2019 @@ -2,10 +2,10 @@ <!-- NewPage --> <html lang="en"> <head> -<!-- Generated by javadoc (1.8.0_191) on Wed Mar 06 16:10:21 CET 2019 --> +<!-- Generated by javadoc (1.8.0_191) on Mon Mar 11 01:36:32 CET 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Overview List (Apache Velocity 2.1-SNAPSHOT API)</title> -<meta name="date" content="2019-03-06"> +<meta name="date" content="2019-03-11"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> Modified: velocity/site/production/engine/devel/apidocs/overview-summary.html URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/apidocs/overview-summary.html?rev=1855189&r1=1855188&r2=1855189&view=diff ============================================================================== --- velocity/site/production/engine/devel/apidocs/overview-summary.html (original) +++ velocity/site/production/engine/devel/apidocs/overview-summary.html Mon Mar 11 00:49:33 2019 @@ -2,10 +2,10 @@ <!-- NewPage --> <html lang="en"> <head> -<!-- Generated by javadoc (1.8.0_191) on Wed Mar 06 16:10:22 CET 2019 --> +<!-- Generated by javadoc (1.8.0_191) on Mon Mar 11 01:36:33 CET 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Overview (Apache Velocity 2.1-SNAPSHOT API)</title> -<meta name="date" content="2019-03-06"> +<meta name="date" content="2019-03-11"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> Modified: velocity/site/production/engine/devel/apidocs/overview-tree.html URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/apidocs/overview-tree.html?rev=1855189&r1=1855188&r2=1855189&view=diff ============================================================================== --- velocity/site/production/engine/devel/apidocs/overview-tree.html (original) +++ velocity/site/production/engine/devel/apidocs/overview-tree.html Mon Mar 11 00:49:33 2019 @@ -2,10 +2,10 @@ <!-- NewPage --> <html lang="en"> <head> -<!-- Generated by javadoc (1.8.0_191) on Wed Mar 06 16:10:22 CET 2019 --> +<!-- Generated by javadoc (1.8.0_191) on Mon Mar 11 01:36:32 CET 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Class Hierarchy (Apache Velocity 2.1-SNAPSHOT API)</title> -<meta name="date" content="2019-03-06"> +<meta name="date" content="2019-03-11"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> Modified: velocity/site/production/engine/devel/apidocs/serialized-form.html URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/apidocs/serialized-form.html?rev=1855189&r1=1855188&r2=1855189&view=diff ============================================================================== --- velocity/site/production/engine/devel/apidocs/serialized-form.html (original) +++ velocity/site/production/engine/devel/apidocs/serialized-form.html Mon Mar 11 00:49:33 2019 @@ -2,10 +2,10 @@ <!-- NewPage --> <html lang="en"> <head> -<!-- Generated by javadoc (1.8.0_191) on Wed Mar 06 16:10:21 CET 2019 --> +<!-- Generated by javadoc (1.8.0_191) on Mon Mar 11 01:36:32 CET 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Serialized Form (Apache Velocity 2.1-SNAPSHOT API)</title> -<meta name="date" content="2019-03-06"> +<meta name="date" content="2019-03-11"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> Modified: velocity/site/production/engine/devel/configuration-property-changes-in-2.1.html URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/configuration-property-changes-in-2.1.html?rev=1855189&r1=1855188&r2=1855189&view=diff ============================================================================== --- velocity/site/production/engine/devel/configuration-property-changes-in-2.1.html (original) +++ velocity/site/production/engine/devel/configuration-property-changes-in-2.1.html Mon Mar 11 00:49:33 2019 @@ -223,21 +223,40 @@ h2:hover > .headerlink, h3:hover > .head visibility: hidden; } h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style> -<h1 id="configuration-changes-in-velocity-engine-21">Configuration Changes in Velocity Engine 2.1<a class="headerlink" href="#configuration-changes-in-velocity-engine-21" title="Permanent link">¶</a></h1> -<h2 id="configuration-property-name-changes">Configuration Property Name Changes<a class="headerlink" href="#configuration-property-name-changes" title="Permanent link">¶</a></h2> -<p>Velocity configuration property names have been reviewed in Engine 2.1 for clarity and consistency.</p> -<p>Old property names are still functional but have been deprecated and will be removed in Engine 3.0. Velocity will emit warnings in the logs when old property names are used.</p> -<p>Property names changes:</p> +<h2 id="configuration-properties-changes-between-engine-20-and-engine-21">Configuration Properties Changes between Engine 2.0 and Engine 2.1<a class="headerlink" href="#configuration-properties-changes-between-engine-20-and-engine-21" title="Permanent link">¶</a></h2> +<p>Velocity Engine configuration property names have been reviewed in Engine 2.1 for clarity and consistency.</p> +<p><strong>Old property names are still functional but have been deprecated</strong> and will be removed in Engine 3.0. Velocity will emit warnings in the logs when old property names are used.</p> +<h3 id="changes-summary">Changes Summary<a class="headerlink" href="#changes-summary" title="Permanent link">¶</a></h3> <table class="table"> <thead> <tr> -<th>Old property name</th> -<th>New property name</th> +<th>2.0 property name</th> +<th>2.1 property name</th> <th>Property purpose</th> </tr> </thead> <tbody> <tr> +<td>runtime.log.instance</td> +<td><em>unchanged</em></td> +<td>org.slf4j.Logger instance</td> +</tr> +<tr> +<td>runtime.log.name</td> +<td><em>unchanged</em></td> +<td>org.slf4j.Logger name</td> +</tr> +<tr> +<td>runtime.log.invalid.references</td> +<td>runtime.log.log_invalid_references</td> +<td>whether to log invalid references</td> +</tr> +<tr> +<td><em>n/a</em></td> +<td>runtime.log.log_invalid_method_calls</td> +<td>whether to log invalid method calls</td> +</tr> +<tr> <td>resource.loader</td> <td>resource.loaders</td> <td>list of resource loader names</td> @@ -253,6 +272,21 @@ h2:hover > .headerlink, h3:hover > .head <td>modification check interval of a named resource loader</td> </tr> <tr> +<td>resource.manager.instance</td> +<td><em>unchanged</em></td> +<td>resource manager live instance</td> +</tr> +<tr> +<td>resource.manager.class</td> +<td><em>unchanged</em></td> +<td>resource manager class</td> +</tr> +<tr> +<td>resource.manager.cache.class</td> +<td><em>unchanged</em></td> +<td>resource manager cache class</td> +</tr> +<tr> <td>resource.manager.defaultcache.size</td> <td>resource.manager.cache.default_size</td> <td>resource manager default cache size</td> @@ -268,16 +302,16 @@ h2:hover > .headerlink, h3:hover > .head <td>enabling scope control object in the context for a specific scope</td> </tr> <tr> -<td>runtime.log.invalid.references</td> -<td>runtime.log.log_invalid_references</td> -<td>whether to log invalid references</td> -</tr> -<tr> <td>runtime.string.interning</td> <td>runtime.string_interning</td> <td>whether to use string interning</td> </tr> <tr> +<td>directive.define.max.depth</td> +<td>directive.define.max_depth</td> +<td>max depth for the <code>#define</code> directive</td> +</tr> +<tr> <td>directive.foreach.maxloops</td> <td>directive.foreach.max_loops</td> <td>maximum number of loops of a <code>#foreach</code> directive</td> @@ -294,18 +328,18 @@ h2:hover > .headerlink, h3:hover > .head </tr> <tr> <td>directive.include.output.errormsg.start</td> -<td>directive.include.output_error_start</td> +<td>directive.include.output_error_start (deprecated)</td> <td>error message prefix for <code>#include</code> and <code>#parse</code></td> </tr> <tr> <td>directive.include.output.errormsg.end</td> -<td>directive.include.output_error_end</td> +<td>directive.include.output_error_end (deprecated)</td> <td>error message suffix for <code>#include</code> and <code>#parse</code></td> </tr> <tr> -<td>directive.define.max.depth</td> -<td>directive.define.max_depth</td> -<td>max depth for the <code>#define</code> directive</td> +<td>directive.parse.max.depth</td> +<td>directive.parse.max_depth</td> +<td>max depth for the <code>#parse</code> directive</td> </tr> <tr> <td>userdirective (undocumented)</td> @@ -338,6 +372,11 @@ h2:hover > .headerlink, h3:hover > .head <td>path to the velocimacro library template</td> </tr> <tr> +<td>velocimacro.library.autoreload</td> +<td><em>unchanged</em></td> +<td>whether to autoreload library</td> +</tr> +<tr> <td>velocimacro.permissions.allow.inline</td> <td>velocimacro.inline.allow</td> <td>whether to allow inline velocimacros</td> @@ -353,6 +392,16 @@ h2:hover > .headerlink, h3:hover > .head <td>whether inline macros have a local scope</td> </tr> <tr> +<td>velocimacro.arguments.strict</td> +<td><em>unchanged</em></td> +<td>expect strict argments number</td> +</tr> +<tr> +<td><em>n/a</em></td> +<td>velocimacro.arguments.preserve_literals</td> +<td>whether invalid references is literal provided argument or argument name</td> +</tr> +<tr> <td>velocimacro.max.depth</td> <td>velocimacro.max_depth</td> <td>velocimacros max calling depth</td> @@ -374,11 +423,21 @@ h2:hover > .headerlink, h3:hover > .head </tr> <tr> <td>runtime.introspector.uberspect</td> -<td>introspector.uberspect</td> +<td>introspector.uberspect.class</td> <td>list of chained uberspectors classnames</td> </tr> <tr> -<td>runtime.conversion.handler.instance (since 2.0)</td> +<td>introspector.restrict.packages</td> +<td><em>unchanged</em></td> +<td>restricted packages for SecureIntrospector</td> +</tr> +<tr> +<td>introspector.restrict.classes</td> +<td><em>unchanged</em></td> +<td>restricted classes for SecureIntrospector</td> +</tr> +<tr> +<td>runtime.conversion.handler.class (since 2.0)</td> <td>introspector.conversion_handler.class</td> <td>method arguments conversion handler classname</td> </tr> @@ -398,6 +457,11 @@ h2:hover > .headerlink, h3:hover > .head <td>key upon which a context should be accessible within itself</td> </tr> <tr> +<td>parser.pool.class</td> +<td><em>unchanged</em></td> +<td>parser pool class</td> +</tr> +<tr> <td>space.gobbling</td> <td>parser.space_gobbling</td> <td>space gobbling mode</td> @@ -405,7 +469,7 @@ h2:hover > .headerlink, h3:hover > .head </tbody> </table> <p>Also, the default velocimacro library template has been renamed from <code>VM_global_library.vm</code> to <code>velocimacros.vtl</code> ; Velocity will check for the old default path if the new one is not found.</p> -<h2 id="new-configuration-properties">New Configuration Properties<a class="headerlink" href="#new-configuration-properties" title="Permanent link">¶</a></h2> +<h2 id="new-properties-description">New Properties Description<a class="headerlink" href="#new-properties-description" title="Permanent link">¶</a></h2> <p>Velocity Engine 2.1 introduces the following new properties:</p> <ul> <li><code>velocimacro.arguments.preserve_literals</code>: 1.7.x backward compatibility flag: if true, when a macro has to dispay an invalid argument, it displays the literal name of the reference passed to the macro, not the literal name of the argument</li> Modified: velocity/site/production/engine/devel/configuration.html URL: http://svn.apache.org/viewvc/velocity/site/production/engine/devel/configuration.html?rev=1855189&r1=1855188&r2=1855189&view=diff ============================================================================== --- velocity/site/production/engine/devel/configuration.html (original) +++ velocity/site/production/engine/devel/configuration.html Mon Mar 11 00:49:33 2019 @@ -223,20 +223,19 @@ h2:hover > .headerlink, h3:hover > .head visibility: hidden; } h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style> -<h2 id="velocity-configuration-contents">Velocity Configuration - Contents<a class="headerlink" href="#velocity-configuration-contents" title="Permanent link">¶</a></h2> +<h2 id="configuration">Configuration<a class="headerlink" href="#configuration" title="Permanent link">¶</a></h2> <div class="toc"> <ul> -<li><a href="#velocity-configuration-contents">Velocity Configuration - Contents</a></li> +<li><a href="#configuration">Configuration</a></li> <li><a href="#configuring-velocity">Configuring Velocity</a></li> +<li><a href="#configuration-summary-tree">Configuration Summary Tree</a></li> <li><a href="#logging">Logging</a></li> -<li><a href="#character-encoding">Character Encoding</a></li> <li><a href="#vtl-directives">VTL Directives</a><ul> <li><a href="#define-directive">#define() Directive</a></li> -<li><a href="#evaluate-directive">#evaluate() Directive</a></li> <li><a href="#foreach-directive">#foreach() Directive</a></li> <li><a href="#if-directive">#if() Directive</a></li> -<li><a href="#set-directive">#set() Directive</a></li> <li><a href="#include-and-parse-directives">#include() and #parse() Directives</a></li> +<li><a href="#custom-directives">custom directives</a></li> </ul> </li> <li><a href="#resource-management">Resource Management</a></li> @@ -258,11 +257,76 @@ h2:hover > .headerlink, h3:hover > .head </ul> </div> <h2 id="configuring-velocity">Configuring Velocity<a class="headerlink" href="#configuring-velocity" title="Permanent link">¶</a></h2> -<p>Velocity's runtime configuration is controlled by a set of configuration keys listed below. Generally, these keys will have values that consist of either a String, or a comma-separated list of Strings, referred to as a CSV for comma-separated values.</p> -<p>There is a set of default values contained in Velocity's jar, found in /src/java/org/apache/velocity/runtime/defaults/velocity.defaults, that Velocity uses as its configuration baseline. This ensures that Velocity will always have a 'correct' value for its configuration keys at startup, although it may not be what you want.</p> -<p>Any values specified before init() time will replace the default values. Therefore, you only have to configure velocity with the values for the keys that you need to change, and not worry about the rest. Further, as we add more features and configuration capability, you don't have to change your configuration files to suit - the Velocity engine will always have default values.</p> -<p>Please sees the section <a href="developer-guide.html#using-velocity"><strong>Using Velocity</strong></a> for discussion on the configuration API.</p> -<p>Below are listed the configuration keys that control Velocity's behavior, organized by category. Each key is listed with its current default value to the right of the '=' sign.</p> +<p>Velocity's runtime configuration is controlled by a set of configuration keys listed below. Generally, these keys will have values that consist of either a String, or a comma-separated list of Strings, referred to as a CSV for comma-separated values.</p> +<p>There is a set of default values contained in Velocity's jar, found in org/apache/velocity/runtime/defaults/velocity.properties, that Velocity uses as its configuration baseline. This ensures that Velocity will always have a 'correct' value for its configuration keys at startup, although it may not be what you want.</p> +<p>Any values specified before init() time will replace the default values. Therefore, you only have to configure velocity with the values for the keys that you need to change, and not worry about the rest. Further, as we add more features and configuration capability, you don't have to change your configuration files to suit - the Velocity engine will always have default values.</p> +<p>Please see the section <a href="developer-guide.html#using-velocity"><strong>Using Velocity</strong></a> for discussion on the configuration API.</p> +<p>The properties key names have been reviewed in Engine 2.1. Old names are still functional but will emit a deprecation warning in the log. See the <a href="configuration-property-changes-in-2.1.html"><strong>table of correspondance</strong></a>.</p> +<h2 id="configuration-summary-tree">Configuration Summary Tree<a class="headerlink" href="#configuration-summary-tree" title="Permanent link">¶</a></h2> +<p>The following tree gathers all non deprecated configuration properties with their default values.</p> +<div class="codehilite"><pre><span class="na">context. +-- scope_control. +-- define</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> | +-- evaluate</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> | +-- foreach</span> <span class="o">=</span> <span class="s">true</span> +<span class="na"> | +-- macro</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> | +-- template</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> | +-- *somebodymacro*</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> +-- self_reference_key</span> <span class="o">=</span> <span class="s">*key_name*</span> + +<span class="na">directive. +-- define.max_depth</span> <span class="o">=</span> <span class="s">2</span> +<span class="na"> +-- foreach. +-- max_loops</span> <span class="o">=</span> <span class="s">-1</span> +<span class="na"> | +-- skip_invalid</span> <span class="o">=</span> <span class="s">true</span> +<span class="na"> +-- if. +-- empty_check</span> <span class="o">=</span> <span class="s">true</span> +<span class="na"> +-- parse. +-- max_depth</span> <span class="o">=</span> <span class="s">10</span> + +<span class="na">event_handler. +-- include.class</span> <span class="o">=</span> <span class="s">*classname*, *classname* ...</span> +<span class="na"> +-- invalid_reference.class</span> <span class="o">=</span> <span class="s">*classname*, *classname* ...</span> +<span class="na"> +-- method_exception.class</span> <span class="o">=</span> <span class="s">*classname*, *classname* ...</span> +<span class="na"> +-- reference_insertion.class</span> <span class="o">=</span> <span class="s">*classname*, *classname* ...</span> + +<span class="na">introspector. +-- conversion_handler. +-- class</span> <span class="o">=</span> <span class="s">org.apache.velocity.util.introspection.TypeConversionHandlerImpl</span> +<span class="na"> | +-- instance</span> <span class="o">=</span> <span class="s">*Java Object instance*</span> +<span class="na"> +-- uberspect.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.util.introspection.UberspectImpl</span> + +<span class="na">parser. +-- allow_hyphen_in_identifiers</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> +-- pool. +-- class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.ParserPoolImpl</span> +<span class="na"> | +-- size</span> <span class="o">=</span> <span class="s">20</span> +<span class="na"> +-- space_gobbling</span> <span class="o">=</span> <span class="s">lines</span> + +<span class="na">resource. +-- default_encoding</span> <span class="o">=</span> <span class="s">UTF-8</span> +<span class="na"> +-- loaders</span> <span class="o">=</span> <span class="s">file, ...</span> +<span class="na"> +-- loader.*loader_name*. +-- class</span> <span class="o">=</span> <span class="s">*classname*</span> +<span class="na"> | +-- instance</span> <span class="o">=</span> <span class="s">*Java Object instance*</span> +<span class="na"> | +-- cache</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> | +-- modification_check_interval</span> <span class="o">=</span> <span class="s">2</span> +<span class="na"> | +-- *loader_prop*</span> <span class="o">=</span> <span class="s">...</span> +<span class="na"> +-- manager. +-- cache. +-- class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.ResourceCacheImpl</span> +<span class="na"> | +-- default_size</span> <span class="o">=</span> <span class="s">89</span> +<span class="na"> +-- class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.ResourceManagerImpl</span> +<span class="na"> +-- instance</span> <span class="o">=</span> <span class="s">null</span> +<span class="na"> +-- log_when_found</span> <span class="o">=</span> <span class="s">true</span> + +<span class="na">runtime. +-- custom_directives</span> <span class="o">=</span> <span class="s">*classname*, *classname* ...</span> +<span class="na"> +-- interpolate_string_literals</span> <span class="o">=</span> <span class="s">true</span> +<span class="na"> +-- log. +-- instance</span> <span class="o">=</span> <span class="s">*Java Object instance*</span> +<span class="na"> | +-- log_invalid_method_calls</span> <span class="o">=</span> <span class="s">true</span> +<span class="na"> | +-- log_invalid_references</span> <span class="o">=</span> <span class="s">true</span> +<span class="na"> | +-- name</span> <span class="o">=</span> <span class="s">org.apache.velocity</span> +<span class="na"> +-- strict_math</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> +-- strict_mode. +-- enable</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> | +-- escape</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> +--string_interning</span> <span class="o">=</span> <span class="s">true</span> + +<span class="na">velocimacro. +-- arguments. +-- preserve_literals</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> | +-- strict</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> +-- body_reference</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> +-- inline. +-- allow</span> <span class="o">=</span> <span class="s">true</span> +<span class="na"> | +-- local_scope</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> | +-- replace_global</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> +-- library. +-- autoreload</span> <span class="o">=</span> <span class="s">false</span> +<span class="na"> +-- path</span> <span class="o">=</span> <span class="s">velocimacros.vtl</span> +</pre></div> + + <h2 id="logging">Logging<a class="headerlink" href="#logging" title="Permanent link">¶</a></h2> <p><strong><code>runtime.log.instance</code></strong> = <em>Java Object instance</em></p> <blockquote> @@ -272,77 +336,68 @@ h2:hover > .headerlink, h3:hover > .head <blockquote> <p>If no living Logger instance has been given using the previous property, Velocity will get a Logger object using the provided name.</p> </blockquote> -<p><strong><code>runtime.log.invalid.references = true</code></strong></p> +<p><strong><code>runtime.log.log_invalid_references = true</code></strong></p> <blockquote> <p>Property to turn off the log output when a reference isn't valid. Good thing to turn off in production, but very valuable for debugging.</p> </blockquote> -<h2 id="character-encoding">Character Encoding<a class="headerlink" href="#character-encoding" title="Permanent link">¶</a></h2> -<p><strong><code>input.encoding = UTF-8</code></strong></p> +<p><strong><code>runtime.log.log_invalid_method_calls = true</code></strong></p> <blockquote> -<p>Character encoding for input (templates). UTF-8 if not specified.</p> +<p>Property to turn off the log output when a method call isn't valid or has thrown. Good thing to turn off in production, but very valuable for debugging.</p> </blockquote> <h2 id="vtl-directives">VTL Directives<a class="headerlink" href="#vtl-directives" title="Permanent link">¶</a></h2> <h3 id="define-directive">#define() Directive<a class="headerlink" href="#define-directive" title="Permanent link">¶</a></h3> -<p><strong><code>define.provide.scope.control = false</code></strong></p> +<p><strong><code>directive.define.max_depth = 2</code></strong></p> <blockquote> -<p>Used to turn on the automatic provision of the $define scope control during #define() calls. The default is false. Set it to true if you want a local, managed namespace you can put references in when within a #define block or if you want it for more advanced #break usage.</p> -</blockquote> -<h3 id="evaluate-directive">#evaluate() Directive<a class="headerlink" href="#evaluate-directive" title="Permanent link">¶</a></h3> -<p><strong><code>evaluate.provide.scope.control = false</code></strong></p> -<blockquote> -<p>Used to turn on the automatic provision of the $evaluate scope during #evaluate() or Velocity[Engine].evaluate(...) calls. The default is false. Set it to true if you want a local, managed namespace you can put references in during an evaluation or if you want it for more advanced #break usage.</p> +<p>Defines the allowable parse depth for the #define directive.</p> </blockquote> <h3 id="foreach-directive">#foreach() Directive<a class="headerlink" href="#foreach-directive" title="Permanent link">¶</a></h3> -<p><strong><code>foreach.provide.scope.control = true</code></strong></p> -<blockquote> -<p>Used to control the automatic provision of the $foreach scope during #foreach calls. This gives access to the foreach status information (e.g. $foreach.index or $foreach.hasNext). The default is true. Set it to false if unused and you want a tiny performance boost.</p> -</blockquote> -<p><strong><code>directive.foreach.maxloops = -1</code></strong></p> +<p><strong><code>directive.foreach.max_loops = -1</code></strong></p> <blockquote> <p>Maximum allowed number of loops for a #foreach() statement.</p> </blockquote> -<p><strong><code>directive.foreach.skip.invalid = true</code></strong></p> +<p><strong><code>directive.foreach.skip_invalid = true</code></strong></p> <blockquote> <p>Tells #foreach to simply skip rendering when the object it is iterating over is not or cannot produce a valid Iterator.</p> </blockquote> <h3 id="if-directive">#if() Directive<a class="headerlink" href="#if-directive" title="Permanent link">¶</a></h3> -<p><strong><code>directive.if.emptycheck = true</code></strong></p> +<p><strong><code>directive.if.empty_check = true</code></strong></p> <blockquote> <p>When evaluating if a reference resolves to <code>true</code> or <code>false</code> 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:</p> <ul> -<li>if <code>directive.if.emptycheck</code> is <code>false</code>, no further check is performed and the object resolves to <code>true</code>.</li> -<li>if <code>directive.if.emptycheck</code> is <code>true</code>, the object is check for emptiness and zero value:<ul> +<li>if <code>directive.if.empty_check</code> is <code>false</code>, no further check is performed and the object resolves to <code>true</code>.</li> +<li>if <code>directive.if.empty_check</code> is <code>true</code>, the object is check for emptiness and zero value:<ul> <li>return whether an array is empty.</li> <li>return whether isEmpty() is false (covers String and all Collection classes).</li> <li>return whether length() is zero (covers CharSequence classes other than String).</li> <li>returns whether size() is zero (covers all Collections classes).</li> <li>return whether a Number <em>strictly</em> equals zero.</li> <li>return whether the result of getAsString() is empty (and false for a null result) if it exists.</li> -<li>return whether the result of getAsNumber() <em>strictly</em> equals zero (and false for a null result) if it exists. </li> +<li>return whether the result of getAsNumber() <em>strictly</em> equals zero (and false for a null result) if it exists.</li> </ul> </li> </ul> </blockquote> -<h3 id="set-directive">#set() Directive<a class="headerlink" href="#set-directive" title="Permanent link">¶</a></h3> -<p><strong><code>directive.set.null.allowed = false</code></strong></p> -<blockquote> -<p>If true, having a right hand side of a #set() statement with an invalid reference or null value will set the left hand side to null. If false, the left hand side will stay the same.</p> -</blockquote> <h3 id="include-and-parse-directives">#include() and #parse() Directives<a class="headerlink" href="#include-and-parse-directives" title="Permanent link">¶</a></h3> -<p><strong><code>directive.include.output.errormsg.start = <!-- include error :</code></strong> -<strong><code>directive.include.output.errormsg.end = see error log --></code></strong></p> +<p><strong><code>directive.include.output_error_start = <!-- include error :</code></strong> +<strong><code>directive.include.output_error_end = see error log --></code></strong></p> <blockquote> -<p>Defines the beginning and ending tags for an in-stream error message in the case of a problem with the #include() directive. If both the .start and .end tags are defined, an error message will be output to the stream, of the form '.start msg .end' where .start and .end refer to the property values. Output to the render stream will only occur if both the .start and .end (next) tag are defined.</p> +<p><em>Deprecated. If/how errors are displayed is not the concern of the engine, which should throw in all cases.</em> +Defines the beginning and ending tags for an in-stream error message in the case of a problem with the #include() directive. If both the .start and .end tags are defined, an error message will be output to the stream, of the form '.start msg .end' where .start and .end refer to the property values. Output to the render stream will only occur if both the .start and .end (next) tag are defined.</p> </blockquote> -<p><strong><code>directive.parse.max.depth = 10</code></strong></p> +<p><strong><code>directive.parse.max_depth = 10</code></strong></p> <blockquote> <p>Defines the allowable parse depth for a template. A template may #parse() another template which itself may have a #parse() directive. This value prevents runaway #parse() recursion.</p> </blockquote> -<p><strong><code>template.provide.scope.control = false</code></strong></p> +<h3 id="custom-directives">custom directives<a class="headerlink" href="#custom-directives" title="Permanent link">¶</a></h3> +<p><strong><code>runtime.custom_directives =</code></strong> <em>empty</em></p> <blockquote> -<p>Used to turn on the automatic provision of the $template scope control during #parse calls and template.merge(...) calls. The default is false. Set it to true if you want a secure namespace for your template variables or more advanced #break control.</p> +<p>coma separated list of custom directives class names, which must inherit from <code>org.apache.velocity.runtime.directive.Directive</code>.</p> </blockquote> <h2 id="resource-management">Resource Management<a class="headerlink" href="#resource-management" title="Permanent link">¶</a></h2> +<p><strong><code>resource.default_encoding = UTF-8</code></strong></p> +<blockquote> +<p>Default character encoding for input (templates). UTF-8 if not specified.</p> +</blockquote> <p><strong><code>resource.manager.instance = null</code></strong></p> <blockquote> <p>Living Java instance, that must implement the interface org.apache.velocity.runtime.resource.ResourceManager. This property can only be set programmatically, and takes precedence over the next property. It is otherwise used by Velocity to store its actual resource manager once instanciated.</p> @@ -352,7 +407,7 @@ h2:hover > .headerlink, h3:hover > .head <p>Replace the Velocity default Resource Manager class. A resource manager implementation must implement the (<code>org.apache.velocity.runtime.resource.ResourceManager</code>)[apidocs/org/apache/velocity/runtime/resource/ResourceManager.html] interface. A description of the requirements of a resource manager is out of scope for this document. Implementors are encouraged to review the default implementation.</p> </blockquote> <p>The following resource management configuration keys only apply to the default Resource Manager.</p> -<p><strong><code>resource.manager.logwhenfound = true</code></strong></p> +<p><strong><code>resource.manager.log_when_found = true</code></strong></p> <blockquote> <p>Switch to control logging of 'found' messages from resource manager. When a resource is found for the first time, the resource name and classname of the loader that found it will be noted in the runtime log.</p> </blockquote> @@ -360,80 +415,72 @@ h2:hover > .headerlink, h3:hover > .head <blockquote> <p>Replace the Velocity default Resource Cache class. A resource cache implementation must implement the (<code>org.apache.velocity.runtime.resource.ResourceCache</code>)[apidocs/org/apache/velocity/runtime/resource/ResourceCache.html] interface As with the resource manager. A description of the requirements of a resource manager is out of scope for this document. Implementors are encouraged to review the default implementation.</p> </blockquote> -<p><strong><code>resource.manager.defaultcache.size = 89</code></strong></p> +<p><strong><code>resource.manager.cache.default_size = 89</code></strong></p> <blockquote> -<p>Sets the size of the default implementation of the resource manager cache size (in number of elements). When <code>resource.manager.defaultcache.size</code> is set to 0, then the default implementation uses the standard Java <code>ConcurrentHashMap</code>. Otherwise, a non-zero cache size uses an LRU Map. The default cache size is 89. Note that the ConcurrentHashMap may be better at thread concurrency.</p> +<p>Sets the size of the default implementation of the resource manager cache size (in number of elements). When <code>resource.manager.cache.default_size</code> is set to 0, then the default implementation uses the standard Java <code>ConcurrentHashMap</code>. Otherwise, a non-zero cache size uses an LRU Map. The default cache size is 89. Note that the ConcurrentHashMap may be better at thread concurrency.</p> </blockquote> -<p><strong><code>resource.loader = file</code></strong></p> +<p><strong><code>resource.loaders = file</code></strong></p> <blockquote> <p><em>Multi-valued key. Will accept CSV for value.</em> Public name of a resource loader to be used. This public name will then be used in the specification of the specific properties for that resource loader. Note that as a multi-valued key, it's possible to pass a value like "file, string" (sans quotes), indicating that following will be configuration values for two loaders.</p> -<p>Please note than <a href="tools/devel">VelocityTools</a> will override the default value and set it to <code>webapp</code>.</p> +<p>In a <a href="/tools/devel/view.html">VelocityToolsView</a> environment, VelocityView will override the default value and set it to <code>webapp</code>, its webapp resource loader.</p> </blockquote> -<p><strong> <em>name</em><code>.loader.description = Velocity File Resource Loader</code></strong></p> +<p><strong> <code>resource.loader.</code><em>name</em><code>.description = Velocity File Resource Loader</code></strong></p> <blockquote> -<p>Description string for the given loader.</p> +<p>Optional description string for the given loader.</p> </blockquote> -<p><strong> <em>name</em><code>.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader</code></strong></p> +<p><strong> <code>resource.loader.</code><em>name</em><code>.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader</code></strong></p> <blockquote> -<p>Name of implementation class for the loader. The default loader is the <a href="/engine/devel/apidocs/org/apache/velocity/runtime/resource/loader/FileResourceLoader.html">file resource loader</a> (or the <a href="/tools/devel/apidocs/org/apache/velocity/tools/view/WebappResourceLoader.html">webapp resource loader</a> for VelocityTools).</p> +<p>Name of implementation class for the loader. The default loader is the <a href="/engine/devel/apidocs/org/apache/velocity/runtime/resource/loader/FileResourceLoader.html">file resource loader</a> (or the <a href="/tools/devel/apidocs/org/apache/velocity/tools/view/WebappResourceLoader.html">webapp resource loader</a> for VelocityTools). See <a href="developer-guide.html#resource-loaders">all available resource loaders</a>.</p> </blockquote> -<p><strong> <em>name</em><code>.resource.loader.path = .</code></strong></p> +<p><strong> <code>resource.loader.</code><em>name</em><code>.path = .</code></strong></p> <blockquote> <p><em>Multi-valued key. Will accept CSV for value.</em> Root(s) from which the loader loads templates. Templates may live in subdirectories of this root. ex. homesite/index.vm This configuration key applies currently to the FileResourceLoader and JarResourceLoader.</p> </blockquote> -<p><strong> <em>name</em><code>.resource.loader.cache = false</code></strong></p> +<p><strong> <code>resource.loader.</code><em>name</em><code>.cache = false</code></strong></p> <blockquote> <p>Controls caching of the templates in the loader. Default is false, to make life easy for development and debugging. This should be set to true for production deployment. When 'true', the <code>modificationCheckInterval</code> property applies. This allows for the efficiency of caching, with the convenience of controlled reloads - useful in a hosted or ISP environment where templates can be modifed frequently and bouncing the application or servlet engine is not desired or permitted.</p> </blockquote> -<p><strong> <em>name</em><code>.resource.loader.modificationCheckInterval = 2</code></strong></p> +<p><strong> <code>resource.loader.</code><em>name</em><code>.modificationCheckInterval = 2</code></strong></p> <blockquote> <p>This is the number of seconds between modification checks when caching is turned on. When this is an integer > 0, this represents the number of seconds between checks to see if the template was modified. If the template has been modified since last check, then it is reloaded and reparsed. Otherwise nothing is done. When <= 0, no modification checks will take place, and assuming that the property <code>cache</code> (above) is true, once a template is loaded and parsed the first time it is used, it will not be checked or reloaded after that until the application or servlet engine is restarted.</p> <p>To illustrate, here is an example taken right from the default Velocity properties, showing how setting up the FileResourceLoader is managed</p> </blockquote> -<div class="codehilite"><pre><span class="na">resource.loader</span> <span class="o">=</span> <span class="s">file</span> +<div class="codehilite"><pre><span class="na">resource.loaders</span> <span class="o">=</span> <span class="s">file</span> -<span class="na">file.resource.loader.description</span> <span class="o">=</span> <span class="s">Velocity File Resource Loader</span> -<span class="na">file.resource.loader.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> -<span class="na">file.resource.loader.path</span> <span class="o">=</span> <span class="s">.</span> -<span class="na">file.resource.loader.cache</span> <span class="o">=</span> <span class="s">false</span> -<span class="na">file.resource.loader.modificationCheckInterval</span> <span class="o">=</span> <span class="s">2</span> +<span class="na">resource.loader.file.description</span> <span class="o">=</span> <span class="s">Velocity File Resource Loader</span> +<span class="na">resource.loader.file.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> +<span class="na">resource.loader.file.path</span> <span class="o">=</span> <span class="s">.</span> +<span class="na">resource.loader.file.cache</span> <span class="o">=</span> <span class="s">false</span> +<span class="na">resource.loader.file.modification_check_interval</span> <span class="o">=</span> <span class="s">2</span> </pre></div> <h2 id="velocimacros">Velocimacros<a class="headerlink" href="#velocimacros" title="Permanent link">¶</a></h2> -<p><strong><code>velocimacro.library = VM_global_library.vm</code></strong></p> +<p><strong><code>velocimacro.library.path = velocimacros.vtl</code></strong></p> <blockquote> -<p><em>Multi-valued key. Will accept CSV for value.</em> Filename(s) of Velocimacro library to be loaded when the Velocity Runtime engine starts. These Velocimacros are accessable to all templates. The file is assumed to be relative to the root of the file loader resource path.</p> +<p><em>Multi-valued key. Will accept CSV for value.</em> Filename(s) of Velocimacro library to be loaded when the Velocity Runtime engine starts. These Velocimacros are accessable to all templates. The file is assumed to be relative to the root of the file loader resource path. If the default (<code>velocimacro.vtl</code> since 2.1) is not found, the old default (<code>VM_global_library.vm</code>) is also searched for.</p> </blockquote> -<p><strong><code>velocimacro.permissions.allow.inline = true</code></strong></p> +<p><strong><code>velocimacro.inline.allow = true</code></strong></p> <blockquote> <p>Determines 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.</p> </blockquote> -<p><strong><code>velocimacro.permissions.allow.inline.to.replace.global = false</code></strong></p> +<p><strong><code>velocimacro.inline.replace_global = false</code></strong></p> <blockquote> <p>Controls if a Velocimacro defind 'inline' in a template can replace a Velocimacro defined in a library loaded at startup.</p> </blockquote> -<p><strong><code>velocimacro.permissions.allow.inline.local.scope = false</code></strong></p> +<p><strong><code>velocimacro.inline.local_scope = false</code></strong></p> <blockquote> <p>Controls '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.</p> </blockquote> -<p><strong><code>velocimacro.context.localscope = false</code></strong></p> -<blockquote> -<p>Controls whether reference access (set/get) within a Velocimacro will change the context, or be of local scope in that Velocimacro. This feature is deprecated and has been removed in Velocity 2.0. Instead, please use the $macro namespace for storage of references local to your Velocimacro. (e.g. #set( $macro.foo = 'bar') and $macro.foo)</p> -</blockquote> <p><strong><code>velocimacro.library.autoreload = false</code></strong></p> <blockquote> -<p>Controls Velocimacro library autoloading. When set to <code>true</code> the source Velocimacro library for an invoked Velocimacro will be checked for changes, and reloaded if necessary. This allows you to change and test Velocimacro libraries without having to restart your application or servlet container, just like you can with regular templates. This mode only works when caching is <em>off</em> in the resource loaders (e.g. <code>file.resource.loader.cache = false</code> ). This feature is intended for development, not for production.</p> +<p>Controls Velocimacro library autoloading. When set to <code>true</code> the source Velocimacro library for an invoked Velocimacro will be checked for changes, and reloaded if necessary. This allows you to change and test Velocimacro libraries without having to restart your application or servlet container, just like you can with regular templates. This mode only works when caching is <em>off</em> in the resource loaders (e.g. <code>resource.loader.file.cache = false</code> ). This feature is intended for development, not for production.</p> </blockquote> <p><strong><code>velocimacro.arguments.strict = false</code></strong></p> <blockquote> <p>When set to true, will throw a <code>ParseErrorException</code> when parsing a template containing a macro with an invalid number of arguments. Is set to false by default to maintain backwards compatibility with templates written before this feature became available.</p> </blockquote> -<p><strong><code>velocimacro.body.reference = false</code></strong></p> -<blockquote> -<p>Defines name of the reference that can be used to get the body content (an AST block) given for a block macro call (e.g. #@myMacro() has a body #end). The default reference name is "bodyContent" (e.g. $bodyContent). This block macro feature was introduced in Velocity 1.7.</p> -</blockquote> -<p><strong><code>velocimacro.preserve.argument.literals = false</code></strong></p> +<p><strong><code>velocimacro.arguments.preserve_literals = false</code></strong></p> <blockquote> <p>Since 2.0, inside a macro, the rendering of null arguments uses the local reference literal. For instance, the following VTL code</p> <div class="codehilite"><pre><span class="cp">#</span><span class="nf">macro</span><span class="p">(</span> <span class="nf">display</span> <span class="p">$</span><span class="nv">foo</span> <span class="p">)</span><span class="x"> </span><span class="p">$</span><span class="nv">foo</span><span class="x"> </span><span class="cp">#</span><span class="nf">end</span><span class="x"></span> @@ -443,30 +490,26 @@ h2:hover > .headerlink, h3:hover > .head <p>will display <code>$foo</code>. To revert to the 1.x behavior, since 2.1, you can set this property to true. The previous code will then display <code>$null</code>.</p> </blockquote> -<p><strong><code>macro.provide.scope.control = false</code></strong></p> +<p><strong><code>velocimacro.body_reference = false</code></strong></p> <blockquote> -<p>Used to turn on the automatic provision of the $macro scope control during #macro calls. The default is false. Set it to true if you need a local namespace in macros or more advanced #break controls.</p> -</blockquote> -<p><strong><code><somebodymacro>.provide.scope.control = false</code></strong></p> -<blockquote> -<p>Used to turn on the automatic provision of the $<nameofthemacro> scope control during a call to a macro with a body (e.g. #@foo #set($foo.a=$b) ... $foo.a #end). The default is false. Set it to true if you happen to need a namespace just for your macro's body content or more advanced #break controls.</p> +<p>Defines name of the reference that can be used to get the body content (an AST block) given for a block macro call (e.g. #@myMacro() has a body #end). The default reference name is "bodyContent" (e.g. $bodyContent). This block macro feature was introduced in Velocity 1.7.</p> </blockquote> <h2 id="strict-reference-setting">Strict Reference Setting<a class="headerlink" href="#strict-reference-setting" title="Permanent link">¶</a></h2> -<p><strong><code>runtime.references.strict = false</code></strong></p> +<p><strong><code>runtime.strict_mode.enable = false</code></strong></p> <blockquote> -<p>When set to true Velocity will throw a <code>MethodInvocationException</code> for references that are not defined in the context, or have not been defined with a #set directive. This setting will also throw an exception if an attempt is made to call a non-existing property on an object or if the object is null. When this property is true then property <code>directive.set.null.allowed</code> is also set to true. Also, <code>directive.foreach.skip.invalid</code> defaults to true when this property is true, but explicitly setting <code>directive.foreach.skip.invalid</code> will override this default. For a complete discussion see <a href="user-guide.html#strict-reference-mode">Strict References Setting</a>.</p> +<p>When set to true Velocity will throw a <code>MethodInvocationException</code> for references that are not defined in the context, or have not been defined with a #set directive. This setting will also throw an exception if an attempt is made to call a non-existing property on an object or if the object is null. When this property is true then property <code>directive.foreach.skip_invalid</code> defaults to true, unless this later property is explicitly set to false. For a complete discussion see <a href="user-guide.html#strict-reference-mode">Strict References Setting</a>.</p> </blockquote> -<p><strong><code>runtime.references.strict.escape = false</code></strong></p> +<p><strong><code>runtime.strict_mode.escape = false</code></strong></p> <blockquote> <p>Changes escape behavior such that putting a forward slash before a reference or macro always escapes the reference or macro and absorbs the forward slash regardless if the reference or macro is defined. For example "\$foo" always renders as "$foo", or "#foo()" is always rendered as "#foo()". This escape behavior is of use in strict mode since unintended strings of characters that look like references or macros will throw an exception. This provides an easy way to escape these references. However, even in non-strict mode the developer may find this a more consistent and reliable method for escaping.</p> </blockquote> <h2 id="string-interpolation">String Interpolation<a class="headerlink" href="#string-interpolation" title="Permanent link">¶</a></h2> -<p><strong><code>runtime.interpolate.string.literals = true</code></strong></p> +<p><strong><code>runtime.interpolate_string_literals = true</code></strong></p> <blockquote> <p>Controls interpolation mechanism of VTL String Literals. Note that a VTL StringLiteral is specifically a string using double quotes that is used in a #set() statement, a method call of a reference, a parameter to a VM, or as an argument to a VTL directive in general. See the VTL reference for further information.</p> </blockquote> <h2 id="math">Math<a class="headerlink" href="#math" title="Permanent link">¶</a></h2> -<p><strong><code>runtime.strict.math = false</code></strong></p> +<p><strong><code>runtime.strict_math = false</code></strong></p> <blockquote> <p>Affects all math operations in VTL. If changed to true, this will cause Velocity to throw a MathException whenever one side of a math operation has a null value (e.g. <code>#set( $foo = $null * 5 )</code>) or when trying to divide by zero. If this value is left <code>false</code>, then rendering will continue and that math operation will be ignored.</p> </blockquote> @@ -479,36 +522,36 @@ h2:hover > .headerlink, h3:hover > .head <blockquote> <p>This property is used by the default pooling implementation to set the number of parser instances that Velocity will create at startup and keep in a pool. The default of 20 parsers should be more than enough for most uses. In the event that Velocity does run out of parsers, it will indicate so in the log, and dynamically create overflow instances as needed. Note that these extra parsers will not be added to the pool, and will be discarded after use. This will result in very slow operation compared to the normal usage of pooled parsers, but this is considered an exceptional condition. A web application using Velocity as its view engine might exhibit this behavior under extremely high concurrency (such as when getting Slashdotted). If you see a corresponding message referencing the <code>parser.pool.size</code> property in your log files, please increment this property immediately to avoid performance degradation.</p> </blockquote> -<p><strong><code>parser.allows.dash.in.identifiers = false</code></strong></p> +<p><strong><code>parser.allow_hyphen_in_identifiers = false</code></strong></p> <blockquote> <p>This is a backward compatibility option, false by default, which allows the '<strong><code>-</code></strong>' character inside variable identifiers (available since 2.1). If enabled, be warned that you will have to surround the mathematical minus sign with spaces for it to be correctly interpreted.</p> </blockquote> <h2 id="event-handlers">Event Handlers<a class="headerlink" href="#event-handlers" title="Permanent link">¶</a></h2> <p>See the <a href="developer-guide.html#event-handlers">Event Handlers</a> section of the dev guide.</p> -<p><strong><code>eventhandler.include.class</code></strong> = <em>classname</em></p> +<p><strong><code>event_handler.include.class</code></strong> = <em>classname</em>, <em>classname</em> ...</p> <blockquote> <p>register an <a href="apidocs/org/apache/velocity/app/event/IncludeEventHandler.html">include event handler</a>.</p> </blockquote> -<p><strong><code>eventhandler.invalidreference.class</code></strong> = <em>classname</em></p> +<p><strong><code>event_handler.invalid_reference.class</code></strong> = <em>classname</em>, <em>classname</em> ...</p> <blockquote> <p>register an <a href="apidocs/org/apache/velocity/app/event/InvalidReferenceEventHandler.html">invalid reference event handler</a>.</p> </blockquote> -<p><strong><code>eventhandler.methodexception.class</code></strong> = <em>classname</em></p> +<p><strong><code>event_handler.method_exception.class</code></strong> = <em>classname</em>, <em>classname</em> ...</p> <blockquote> <p>register a <a href="apidocs/org/apache/velocity/app/event/MethodExceptionEventHandler.html">method exception event handler</a>.</p> </blockquote> -<p><strong><code>eventhandler.referenceinsertion.class</code></strong> = <em>classname</em></p> +<p><strong><code>event_handler.reference_insertion.class</code></strong> = <em>classname</em>, <em>classname</em> ...</p> <blockquote> <p>register a <a href="apidocs/org/apache/velocity/app/event/ReferenceInsertionEventHandler.html">reference insertion event handler</a>.</p> </blockquote> <h2 id="introspection">Introspection<a class="headerlink" href="#introspection" title="Permanent link">¶</a></h2> <p>Introspection is the process of mapping properties, methods and iterators of VTL references to Java objects. The object responsible of the introspection strategy in Velocity is called an <em>uberspector</em>.</p> -<p><strong><code>runtime.introspector.uberspect = org.apache.velocity.util.introspection.UberspectImpl</code></strong></p> +<p><strong><code>introspector.uberspect.class = org.apache.velocity.util.introspection.UberspectImpl</code></strong></p> <blockquote> <p>This property sets the 'Uberspector', the introspection package that handles all introspection strategies for Velocity. You can specify a comma-separated list of Uberspector classes, in which case all Uberspectors are chained. The default chaining behaviour is to return the first non-null value for each introspection call among all provided uberspectors. You can modify this behaviour (for instance to restrict access to some methods) by subclassing org.apache.velocity.util.introspection.AbstractChainableUberspector (or implementing directly org.apache.velocity.util.introspection.ChainableUberspector). This allows you to create more interesting rules or patterns for Uberspection, rather than just returning the first non-null value.</p> -<p>Some alternate Uberspectors are provided within the Velocity package. Please refer to the <a href="developer-guide.html#customizing-introspection">Customizing Introspection</a> section for a detailed list. You would for instance use <code>runtime.introspector.uberspect = org.apache.velocity.util.introspection.SecureUberspector</code> to avoid template authors to instanciate new classes or to use reflection, or use <code>runtime.introspector.uberspect = org.apache.velocity.util.introspection.UberspectImpl, org.apache.velocity.util.introspection.UberspectPublicFields</code> to expose Java public fields in your templates.</p> +<p>Some alternate Uberspectors are provided within the Velocity package. Please refer to the <a href="developer-guide.html#customizing-introspection">Customizing Introspection</a> section for a detailed list. You would for instance use <code>introspector.uberspect.class = org.apache.velocity.util.introspection.SecureUberspector</code> to avoid template authors to instanciate new classes or to use reflection, or use <code>introspector.uberspect.class = org.apache.velocity.util.introspection.UberspectImpl, org.apache.velocity.util.introspection.UberspectPublicFields</code> to expose Java public fields in your templates.</p> </blockquote> -<p><strong><code>runtime.conversion.handler.class = org.apache.velocity.util.introspection.TypeConversionHandlerImpl</code></strong></p> +<p><strong><code>introspector.conversion_handler.class = org.apache.velocity.util.introspection.TypeConversionHandlerImpl</code></strong></p> <blockquote> <p>This configuration option is only taken into account by the default uberspector (UberspectImpl) and its subclasses (like SecureUberspector). It can be set to:</p> <ul> @@ -517,22 +560,46 @@ h2:hover > .headerlink, h3:hover > .head </ul> <p>The default conversion handler will try to convert values between all number, boolean and string types (along with a Locale to string conversion since 2.1). Failed conversions will throw a MethodInvocationException (or call the registered MethodExceptionEventHandler, if any). Watch out for conversions towards boolean: non-zero numbers and the "true" String are true, everything else is false. This differs slighly from the <code>#if($reference)</code> truthness rules, where all non-null numbers and all non-null and non-empty strings are true.</p> </blockquote> -<p><strong><code>runtime.conversion.handler.instance</code></strong> = <em>Java Object instance</em></p> +<p><strong><code>introspector.conversion_handler.instance</code></strong> = <em>Java Object instance</em></p> <blockquote> <p>This configuration option is only taken into account by the default uberspector (UberspectImpl) and its subclasses (like SecureUberspector). It can be set to a living Java instance of an object implementing the interface <a href="apidocs/org/apache/velocity/util/introspection/TypeConversionHandler.html">org.apache.velocity.util.introspection.TypeConversionHandler</a> or the deprecated (since 2.1) interface <a href="apidocs/org/apache/velocity/util/introspection/ConversionHandler.html">org.apache.velocity.util.introspection.ConversionHandler</a>.</p> </blockquote> <h2 id="context">Context<a class="headerlink" href="#context" title="Permanent link">¶</a></h2> -<p><strong><code>context.autoreference.key = <key name></code></strong></p> +<p><strong><code>context.self_reference_key = <key name></code></strong></p> +<blockquote> +<p>This property has no default value. If present, the Context object will become accessible from the templates under the provided name. For instance, with the configuration "<code>context.self_reference_key = self</code>", then <code>$self</code> will contain the context itself. This feature is meant to be used for debugging purposes.</p> +</blockquote> +<p><strong><code>context.scope_control.define = false</code></strong></p> +<blockquote> +<p>Used to turn on the automatic provision of the $define scope control during #define() calls. The default is false. Set it to true if you want a local, managed namespace you can put references in when within a #define block or if you want it for more advanced #break usage.</p> +</blockquote> +<p><strong><code>context.scope_control.evaluate = false</code></strong></p> +<blockquote> +<p>Used to turn on the automatic provision of the $evaluate scope during #evaluate() or Velocity[Engine].evaluate(...) calls. The default is false. Set it to true if you want a local, managed namespace you can put references in during an evaluation or if you want it for more advanced #break usage.</p> +</blockquote> +<p><strong><code>context.scope_control.foreach = true</code></strong></p> <blockquote> -<p>This property has no default value. If present, the Context object will become accessible from the templates under the provided name. For instance, with the configuration "<code>context.autoreference.key = self</code>", then <code>$self</code> will contain the context itself. This feature is meant to be used for debugging purposes.</p> +<p>Used to control the automatic provision of the $foreach scope during #foreach calls. This gives access to the foreach status information (e.g. $foreach.index or $foreach.hasNext). The default is true. Set it to false if unused and you want a tiny performance boost.</p> +</blockquote> +<p><strong><code>context.scope_control.macro = false</code></strong></p> +<blockquote> +<p>Used to turn on the automatic provision of the $macro scope control during #macro calls. The default is false. Set it to true if you need a local namespace in macros or more advanced #break controls.</p> +</blockquote> +<p><strong><code>context.scope_control.template = false</code></strong></p> +<blockquote> +<p>Used to turn on the automatic provision of the $template scope control during #parse calls and template.merge(...) calls. The default is false. Set it to true if you want a secure namespace for your template variables or more advanced #break control.</p> +</blockquote> +<p><strong><code>context.scope_control.<somebodymacro> = false</code></strong></p> +<blockquote> +<p>Used to turn on the automatic provision of the $<nameofthemacro> scope control during a call to a macro with a body (e.g. #@foo #set($foo.a=$b) ... $foo.a #end). The default is false. Set it to true if you happen to need a namespace just for your macro's body content or more advanced #break controls.</p> </blockquote> <h2 id="string-interning">String Interning<a class="headerlink" href="#string-interning" title="Permanent link">¶</a></h2> -<p><strong><code>runtime.string.interning = true</code></strong></p> +<p><strong><code>runtime.string_interning = true</code></strong></p> <blockquote> <p>This property specifies whether to use Java (String interning)[https://en.wikipedia.org/wiki/String_interning] on identifiers. This may save some memory when set to true, and run a little bit faster when set to false.</p> </blockquote> <h2 id="space-gobbling">Space Gobbling<a class="headerlink" href="#space-gobbling" title="Permanent link">¶</a></h2> -<p><strong><code>space.gobbling = lines</code></strong></p> +<p><strong><code>parser.space_gobbling = lines</code></strong></p> <blockquote> <p>Space gobbling policy. See the <a href="developer-guide.html#space-gobbling">Space Gobbling section</a> in the developer guide. Possible values are: - <code>none</code> : no space gobbling at all. @@ -544,44 +611,44 @@ h2:hover > .headerlink, h3:hover > .head <h3 id="resource-loading">Resource loading<a class="headerlink" href="#resource-loading" title="Permanent link">¶</a></h3> <p>Configuring the resource loaders for Velocity is straightforward. The properties that control the are listed in the <a href="#Configuring_Resource_Loaders">resource configuration</a> section, for further reference.</p> <p>The first step in configuring one or more resource loaders is do 'declare' them by name to Velocity. Use the property <code>resource.loader</code> and list one or more loader names. You can use anything you want - these names are used to associate configuration properties with a given loader.</p> -<div class="codehilite"><pre><span class="na">resource.loader</span> <span class="o">=</span> <span class="s">file</span> +<div class="codehilite"><pre><span class="na">resource.loaders</span> <span class="o">=</span> <span class="s">file</span> </pre></div> <p>That entry declares that we will have a resource loader known as 'file'. The next thing to do is to set the important properties. The most critical is to declare the class to use as the loader:</p> -<div class="codehilite"><pre><span class="na">file.resource.loader.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> +<div class="codehilite"><pre><span class="na">resource.loader.file.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> </pre></div> <p>In this case, we are telling velocity that we are setting up a resource loadercalled 'file', and are using the class <code>org.apache.velocity.runtime.resource.loader.FileResourceLoader</code> to be the class to use. The next thing we do is set the properties important to this loader.</p> -<div class="codehilite"><pre><span class="na">file.resource.loader.path</span> <span class="o">=</span> <span class="s">/opt/templates</span> -<span class="na">file.resource.loader.cache</span> <span class="o">=</span> <span class="s">true</span> -<span class="na">file.resource.loader.modificationCheckInterval</span> <span class="o">=</span> <span class="s">2</span> +<div class="codehilite"><pre><span class="na">resource.loader.file.path</span> <span class="o">=</span> <span class="s">/opt/templates</span> +<span class="na">resource.loader.file.cache</span> <span class="o">=</span> <span class="s">true</span> +<span class="na">resource.loader.file.modification_check_interval</span> <span class="o">=</span> <span class="s">2</span> </pre></div> <p>Here, we set a few things. First, we set the path to find the templates to be <code>/opt/templates</code>. Second, we turned caching on, so that after a template or static file is read in, it is cached in memory. And finally, we set the modification check interval to 2 seconds, allowing Velocity to check for new templates.</p> <p>Those are the basics. What follows are a few examples of different configuraitons.</p> <p><strong>Do-nothing Default Configuration: </strong> As the name says, there is nothing you have to do or configure to get the default configuration. This configuration uses the FileResourceLoader with the current directory as the default resource path, and caching is off. As a properties set, this is expressed as:</p> -<div class="codehilite"><pre><span class="na">resource.loader</span> <span class="o">=</span> <span class="s">file</span> +<div class="codehilite"><pre><span class="na">resource.loaders</span> <span class="o">=</span> <span class="s">file</span> -<span class="na">file.resource.loader.description</span> <span class="o">=</span> <span class="s">Velocity File Resource Loader</span> -<span class="na">file.resource.loader.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> -<span class="na">file.resource.loader.path</span> <span class="o">=</span> <span class="s">.</span> -<span class="na">file.resource.loader.cache</span> <span class="o">=</span> <span class="s">false</span> -<span class="na">file.resource.loader.modificationCheckInterval</span> <span class="o">=</span> <span class="s">0</span> +<span class="na">resource.loader.file.description</span> <span class="o">=</span> <span class="s">Velocity File Resource Loader</span> +<span class="na">resource.loader.file.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> +<span class="na">resource.loader.file.path</span> <span class="o">=</span> <span class="s">.</span> +<span class="na">resource.loader.file.cache</span> <span class="o">=</span> <span class="s">false</span> +<span class="na">resource.loader.file.modification_check_interval</span> <span class="o">=</span> <span class="s">0</span> </pre></div> <p><strong>Multiple Template Path Configuration: </strong> This configuration uses the FileResourceLoader with several directories as 'nodes' on the template search path. We also want to use caching, and have the templates checked for changes in 10 second intervals. As a properties set, this is expressed as:</p> -<div class="codehilite"><pre><span class="na">resource.loader</span> <span class="o">=</span> <span class="s">file</span> +<div class="codehilite"><pre><span class="na">resource.loaders</span> <span class="o">=</span> <span class="s">file</span> -<span class="na">file.resource.loader.description</span> <span class="o">=</span> <span class="s">Velocity File Resource Loader</span> -<span class="na">file.resource.loader.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> -<span class="na">file.resource.loader.path</span> <span class="o">=</span> <span class="s">/opt/directory1, /opt/directory2</span> -<span class="na">file.resource.loader.cache</span> <span class="o">=</span> <span class="s">true</span> -<span class="na">file.resource.loader.modificationCheckInterval</span> <span class="o">=</span> <span class="s">10</span> +<span class="na">resource.loader.file.description</span> <span class="o">=</span> <span class="s">Velocity File Resource Loader</span> +<span class="na">resource.loader.file.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> +<span class="na">resource.loader.file.path</span> <span class="o">=</span> <span class="s">/opt/directory1, /opt/directory2</span> +<span class="na">resource.loader.file.cache</span> <span class="o">=</span> <span class="s">true</span> +<span class="na">resource.loader.file.modification_check_interval</span> <span class="o">=</span> <span class="s">10</span> </pre></div> @@ -589,31 +656,31 @@ a resource loadercalled 'file', and are <div class="codehilite"><pre><span class="c">#</span> <span class="c"># specify three resource loaders to use</span> <span class="c">#</span> -<span class="na">resource.loader</span> <span class="o">=</span> <span class="s">file, class, jar</span> +<span class="na">resource.loaders</span> <span class="o">=</span> <span class="s">file, class, jar</span> <span class="c">#</span> <span class="c"># for the loader we call 'file', set the FileResourceLoader as the</span> <span class="c"># class to use, turn off caching, and use 3 directories for templates</span> <span class="c">#</span> -<span class="na">file.resource.loader.description</span> <span class="o">=</span> <span class="s">Velocity File Resource Loader</span> -<span class="na">file.resource.loader.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> -<span class="na">file.resource.loader.path</span> <span class="o">=</span> <span class="s">templatedirectory1, anotherdirectory, foo/bar</span> -<span class="na">file.resource.loader.cache</span> <span class="o">=</span> <span class="s">false</span> -<span class="na">file.resource.loader.modificationCheckInterval</span> <span class="o">=</span> <span class="s">0</span> +<span class="na">resource.loader.file.description</span> <span class="o">=</span> <span class="s">Velocity File Resource Loader</span> +<span class="na">resource.loader.file.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.FileResourceLoader</span> +<span class="na">resource.loader.file.path</span> <span class="o">=</span> <span class="s">templatedirectory1, anotherdirectory, foo/bar</span> +<span class="na">resource.loader.file.cache</span> <span class="o">=</span> <span class="s">false</span> +<span class="na">resource.loader.file.modification_check_interval</span> <span class="o">=</span> <span class="s">0</span> <span class="c">#</span> <span class="c"># for the loader we call 'class', use the ClasspathResourceLoader</span> <span class="c">#</span> -<span class="na">class.resource.loader.description</span> <span class="o">=</span> <span class="s">Velocity Classpath Resource Loader</span> -<span class="na">class.resource.loader.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</span> +<span class="na">resource.loader.class.description</span> <span class="o">=</span> <span class="s">Velocity Classpath Resource Loader</span> +<span class="na">resource.loader.class.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</span> <span class="c">#</span> <span class="c"># and finally, for the loader we call 'jar', use the JarResourceLoader</span> <span class="c"># and specify two jars to load from</span> <span class="c">#</span> -<span class="na">jar.resource.loader.description</span> <span class="o">=</span> <span class="s">Velocity Jar Resource Loader</span> -<span class="na">jar.resource.loader.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.JarResourceLoader</span> -<span class="na">jar.resource.loader.path</span> <span class="o">=</span> <span class="s">jar:file:/myjarplace/myjar.jar, jar:file:/myjarplace/myjar2.jar</span> +<span class="na">resource.loader.jar.description</span> <span class="o">=</span> <span class="s">Velocity Jar Resource Loader</span> +<span class="na">resource.loader.jar.class</span> <span class="o">=</span> <span class="s">org.apache.velocity.runtime.resource.loader.JarResourceLoader</span> +<span class="na">resource.loader.jar.path</span> <span class="o">=</span> <span class="s">jar:file:/myjarplace/myjar.jar, jar:file:/myjarplace/myjar2.jar</span> </pre></div> @@ -622,19 +689,19 @@ a resource loadercalled 'file', and are <h3 id="backward-compatibility">Backward compatibility<a class="headerlink" href="#backward-compatibility" title="Permanent link">¶</a></h3> <p>The following configuration maximizes the backward compatibility with Velocity 1.7.</p> <div class="codehilite"><pre><span class="c"># No automatic conversion of methods arguments</span> -<span class="na">runtime.conversion.handler</span> <span class="o">=</span> <span class="s">none</span> +<span class="na">introspector.conversion_handler.class</span> <span class="o">=</span> <span class="s">none</span> <span class="c"># Use backward compatible space gobbling</span> -<span class="na">space.gobbling</span> <span class="o">=</span> <span class="s">bc</span> +<span class="na">engine.space_gobbling</span> <span class="o">=</span> <span class="s">bc</span> <span class="c"># Have #if($foo) only returns false if $foo is false or null</span> -<span class="na">directive.if.emptycheck</span> <span class="o">=</span> <span class="s">false</span> +<span class="na">directive.if.empty_check</span> <span class="o">=</span> <span class="s">false</span> <span class="c"># Allow '-' in identifiers</span> -<span class="na">parser.allows.dash.identifiers</span> <span class="o">=</span> <span class="s">true</span> +<span class="na">parser.allow_hyphen_in_identifiers</span> <span class="o">=</span> <span class="s">true</span> <span class="c"># When displaying null arguments literals, use provided arguments literals</span> -<span class="na">velocimacro.preserve.arguments.literals</span> <span class="o">=</span> <span class="s">true</span> +<span class="na">velocimacro.arguments.preserve_literals</span> <span class="o">=</span> <span class="s">true</span> </pre></div></div></div> <hr/> <div id="copyright">
