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:
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
package com.samskivert.velocity;
|
package com.samskivert.velocity;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.servlet.ServletConfig;
|
import javax.servlet.ServletConfig;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
|
|
||||||
@@ -125,6 +127,14 @@ public class Application
|
|||||||
didInit(config);
|
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
|
* Looks up an initialization parameter for this application. The
|
||||||
* default implementation retrieves the value from the servlet config,
|
* 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,
|
props.setProperty(RuntimeSingleton.RUNTIME_LOG_LOGSYSTEM_CLASS,
|
||||||
ServletContextLogger.class.getName());
|
ServletContextLogger.class.getName());
|
||||||
|
|
||||||
|
// let the application set up other properties
|
||||||
|
_app.configureVelocity(config, props);
|
||||||
|
|
||||||
// now return our augmented properties
|
// now return our augmented properties
|
||||||
return props;
|
return props;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user