[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-dev
Subject:    DO NOT REPLY [Bug 16409] New:  -
From:       bugzilla () apache ! org
Date:       2003-01-24 21:35:45
[Download RAW message or body]

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16409>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16409

calling Velocity.setProperty() is not immutable

           Summary: calling Velocity.setProperty() is not immutable
           Product: Velocity
           Version: 1.3-rc1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Source
        AssignedTo: velocity-dev@jakarta.apache.org
        ReportedBy: dgeise@truelink.com


Calling Velocity.setProperty() does not appear to work after the call to 
Velocity.init(), but it does work before.  Example:

   public void ejbCreate() {
      mLogger.info("Creating Velocity Template Engine");

      // initialize velocity template engine (currently using singleton model)
      try {
         Properties p = new Properties();
         p.setProperty("file.resource.loader.cache", "true");			
				// cache resources
         p.setProperty("file.resource.loader.modificationCheckInterval","0");	
	// don't poll for changes
         p.setProperty("file.resource.loader.path",
         LCFConfig.getApplicationContext().getRealPath("/") + "templates/");
	// load files from templates folder

         // hook Velocity into custom log4j wrapper to reduce spamming the logs 
at the INFO level
         // (wrapper demotes log INFO messages to DEBUG)
         p.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, 
VelocityLogger.class.getName());
         p.setProperty("runtime.log.logsystem.log4j.category", 
ContentGeneratorBean.class.toString());

         // configure and initialize velocity
         Velocity.init(p);

         // reset velocity logger to it's log4j default to allow post init 
messages (parse errors, etc through)
         // NOTE:  THIS DOES NOT APPEAR TO HAVE ANY EFFECT.
         Velocity.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
            "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
      }
      catch (Exception e) {
         mLogger.error("Velocity initialization: general exception: " + e);
         return;
      }
   }

--
To unsubscribe, e-mail:   <mailto:velocity-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-dev-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic