How to set global properties

Paul Moore <[email protected]> Fri, 11 Oct 2013 18:06:13 +0100
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <CA+Lh8bDs77wXLP3G7S_i9QXX=9Q+SryCxv6pG-trR4JSxtqMsA@mail.gmail.com>
Hi,

I am working on integrating Velocity with Jersey 2.x and am having some
trouble setting the value of a global property, specifically
ViewToolManager's 'createSession'.

Essentially, I am establishing a VelocityView configured from an
ExtendedProperties object.  The toolbox config is being parsed into a
PropertiesFactoryConfiguration and being made available at the expected
servlet location.

The tool configuration works fine, e.g.

ve.addProperty("tools.toolbox", "request,session");
ve.addProperty("tools.request.example",
"org.glassfish.jersey.examples.velocity.tools.ExampleTool");

but I can't find a way to configure global properties (of which
createSession is one - see ViewToolManager.getCreateSession().

I've tried the following syntax, located in various parts of the
documentation:

tools.session.property.create-session = true
tools.session.property.create-session.type = boolean
tools.session.map = java.util.HashMap


but this (reasonably) sets 'session' scoped properties.

I think I need to set the property at the 'tools' level, but have tried the
following without success:

 tools.property.create-session = true
 tools.property.createSession = true

Can anybody suggest what the path syntax of global properties should be?

Many thanks

Paul