Today, working towards the 1.0 release, Jason finished his cleanup of
the Velocity properties.
This may cause pain, as things changed. But they are for the better, so
before you use the latest build with existing apps / servlets, make sure
you update your properties, and move Runtime class calls to Velocity
class calls.
Many people probably rely on the built-in default properties, so this
won't be as heinous as it appears - I believe most people use only a few
anyway.
This involved two sets of changes :
1) property names : many have been changed to normalize their patterns
and make the meanings clear. Therefore, if you have velocity.properties
files, you will need to change the properties. The new properties can
be found in
/org/apache/velocity/runtime/defaults/velocity.properties
as well as described in the developer docs on the site (will be checked
in tonight...).
The biggest changes are how the resources are set up, and the addition
of 'multi-valued properties' :
resource set up :
resource.loader = <name>
<name>.resource.loader.path = <path1>,<path2>,<path3>
<name>.resource.loader.cache = false
(etc)
ex (from the defaults)
resource.loader = file
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = .
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2
Further, resource.loader and <name>.resource.loader.path should support
multiple, comma-separated values to have multiple simultaneous loaders,
as well as multiple paths for the FileResourceLoader and the
JarResourceLoader.
2) configuration API : the configuration API should be accessed via the
o.a.v.app.Velocity class :
Velocity.setProperty( String, Object)
Object Velocity.getProperty( String )
Velocity.init()
Velocity.init( filename )
Velocity.init( Properties )
These delegate through to the Runtime class, but we reserve the right to
do what we want in Runtime, and will do everything possible to keep the
application API stable in Velocity. For instance, I suppose that
Runtime.init( filename) and Runtime.init( Properties ) might go away.
Over there next few days, there will be a few nips and tucks as this
gets finished, so try to pay attention :)
geir
--
Geir Magnusson Jr. [EMAIL PROTECTED]
Developing for the web? See http://jakarta.apache.org/velocity/