velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morten Hoyer <>
Subject Re: Problems with macros and includes?
Date Fri, 06 Dec 2002 17:29:50 GMT

Thanks for the feedback. 
Unfortunately, it turns out that we are actually using #parse. We have a
utility class with a method named include, but behind the scenes, it returns
the velocity directive '#parse'.

The funny thing is that it DOES actually execute the macros in the
included/parsed file, if there's a dummy macro in the base template. 

Thanks again,
Morten Hoyer

>RTM! :)
>#include is meant to function exactly as you describe.
>it sounds like you actually want #parse
>Nathan Bubna
>Morten said:
>> Hi,
>> We have a template that uses the #include directive to include a template
>> with a number of macros. By default, this does not seem to work. The
>> is that the contents of the included file is simply flushed directly to
>> output stream. We were able to work around this by adding a dummy macro
>> the base template, for example:
>> #macro( nothing )
>> #end
>> This dummy macro is not being referred to in any way, but it appears like
>> velocity is able to execute the macros in the included file only when
>> there's at least one macro in the base template.
>> We are using velocity 1.3.1 rc-2 and jdk 1.4.0.
>> Any help is appreciated.
>> Sincerely,
>> Morten Hoyer

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message