You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by bu...@apache.org on 2003/07/02 04:08:50 UTC

DO NOT REPLY [Bug 21258] New: - provide access to underlying VelocityEngine instance of Velocity class

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=21258>.
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=21258

provide access to underlying VelocityEngine instance of Velocity class

           Summary: provide access to underlying VelocityEngine instance of
                    Velocity class
           Product: Velocity
           Version: 1.3.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Source
        AssignedTo: velocity-dev@jakarta.apache.org
        ReportedBy: dkokotov@vecna.com


It would be nice to be able to access the underlying VelocityEngine instance to
which the Velocity facade class delegates. That way i can have logic that either
uses a default application-wide velocity config or a specific one, i.e.

public class AppConfig {
  public void init (...) {
    // init app-wide velocity 
    Velocity.init (..);
  }
}

public class Foo {
  private VelocityEngine m_engine;

  public void init (String velConfigFile, ...) {
    ..
    if (velConfigFile != null) {
      m_engine = new VelocityEngine ();
      m_engine.init (velConfigFile);
    } else {
      m_engine = Velocity.getEngine ();
    }
  }

  // other methods use m_engine
}

As it is now, to do something like this you'd have to have everywhere you use
velocity the logic of

if (haveOwnConfig) {
  my_engine.merge (..);
} else {
  Velocity.merge (..);
}

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