代码之家  ›  专栏  ›  技术社区  ›  marcelo-ferraz

如何正确初始化Nvelocity引擎?

  •  0
  • marcelo-ferraz  · 技术社区  · 15 年前

    正如我在一些例子中看到的,并试图理解 velocity site ,有三种初始化速度引擎的方法:
    -使用默认配置: In()
    -使用默认配置,加上文件中的属性: init(字符串)
    -使用默认配置,加上集合中的属性: .init(commons.collections.extendedproperties)

    但我几乎找不到关于这些如何工作的解释。例如,在我下载的应用程序中:

    VelocityEngine engine = new VelocityEngine();
    ExtendedProperties props = new ExtendedProperties();
    props.AddProperty("file.resource.loader.path", new ArrayList(new string[] { ".", @".\Templates" }));
    engine.Init(props);
    

    除了显而易见的假设,什么是 文件.resource.loader.path “?
    我可以更改哪些其他属性,以及如何更改它们(我的意思是,使用addproperty,或者如果有其他方法,请指定)?

    1 回复  |  直到 15 年前
        1
  •  1
  •   serg    15 年前

    Here 是可用属性的列表。