Allow an application to get in on the Velocity configuration process.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1539 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2004-12-08 01:46:54 +00:00
parent 51bcd06a15
commit 8cd5ea5f0d
2 changed files with 13 additions and 0 deletions
@@ -20,6 +20,8 @@
package com.samskivert.velocity;
import java.util.Properties;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
@@ -125,6 +127,14 @@ public class Application
didInit(config);
}
/**
* Called prior to initializing Velocity to allow the application to
* specify custom configuration properties.
*/
protected void configureVelocity (ServletConfig config, Properties props)
{
}
/**
* Looks up an initialization parameter for this application. The
* default implementation retrieves the value from the servlet config,
@@ -243,6 +243,9 @@ public class DispatcherServlet extends VelocityServlet
props.setProperty(RuntimeSingleton.RUNTIME_LOG_LOGSYSTEM_CLASS,
ServletContextLogger.class.getName());
// let the application set up other properties
_app.configureVelocity(config, props);
// now return our augmented properties
return props;
}