Hi, I am trying to migrate to Velocity Tools 2.0. My application currently needs to set a Velocity Property to a value that is determined at run-time. For example, I would like to set a property to one of two possible values, based on the current setting of my application's debug value. Before, I did this by simply overwriting the loadConfiguration() method:

   protected Properties loadConfiguration( ServletConfig config )
        throws IOException, FileNotFoundException
   {
        Properties velocityProps = new Properties(  );
        if ( localDir != null ) {
            velocityProps.setProperty(
   Velocity.FILE_RESOURCE_LOADER_PATH, localDir );
        }
        velocityProps.setProperty( Velocity.RUNTIME_LOG, localDir +
   "velocity.log" );
        velocityProps.setProperty(
   Velocity.RUNTIME_LOG_LOGSYSTEM_CLASS, debugFlag ?
"org.apache.velocity.runtime.log.SimpleLog4JLogSystem" : "org.apache.velocity.runtime.log.NullLogSystem" );
        return velocityProps;
   }


How can I accomplish the same thing in Tools 2.0?
Thanks in advance for your help.
 - Scott Smith

Reply via email to