velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: macros in other templates
Date Sat, 09 Mar 2002 16:26:55 GMT
On 3/9/02 11:06 AM, "Sebastien Chassande-Barrioz"
<sebastien.chassande@inrialpes.fr> wrote:

> Geir Magnusson Jr. wrote:
> 
>> So I would redo the above as
>> 
>> VelocityEngine ve = new VelocityEngine();
>> ve.setProperty( VelocityEngine.RUNTIME_LOG_LOGSYSTEM, this);
>> ve.setProperty( VelocityEngine. FILE_RESOURCE_LOADER_PATH,
>>            "/src/templates");
>> ve.setProperty( "velocimacro.library", "file2.vm");
>> ve.init();
>> 
>> And that should work.
> 
> yes, and thank you for your help. It's perfact. In fact I specify a
> basic path for the FILE_RESOURCE_LOADER_PATH property, and a comma list
> of .vm file with relative path to the FILE_RESOURCE_LOADER_PATH for the
> VM_LIBRARY property:
> ve = new VelocityEngine();
> ve.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, "/src/templates");
> ve.setProperty(Velocity.VM_LIBRARY, "mydir1/file1.vm,mydir2/file2.vm");
> ve.init();
> 
> I have a last question: If two files (file1.vm & file2.vm) define a
> macro with the same name(toto), wich macro is called ? (toto in file1.vm
> or toto in file2.vm ?)

The one that gets loaded last.

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
My inner cowboy needs to yodel.


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


Mime
View raw message