You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Daniel Page <za...@hotmail.com> on 2004/07/16 22:48:18 UTC
Velocity - include script element
Where do you find the TEMPLATE_ROOT (what folder or directory)?
I want to include a file to a macro. Please advise.
_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page FREE
download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: Velocity - include script element
Posted by Carsten Heyl <ca...@pixelboxx.de>.
Daniel Page wrote:
> Where do you find the TEMPLATE_ROOT (what folder or directory)?
> I want to include a file to a macro. Please advise.
>
> _________________________________________________________________
> MSN Toolbar provides one-click access to Hotmail from any Web page –
> FREE download!
> http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
I searched for that secret some time ago, too.
You have to add your dir to property "file.resource.loader.path".
In our case it's installation dependant and must be absolute, so I'm
using the following.
appendToProperty(props, "file.resource.loader.path",
templateRootDir.getAbsolutePath());
private void appendToProperty(Properties props, String key, String value) {
String path = props.getProperty(key);
if (path == null) {
path = value;
} else {
path = path + "," + value;
}
props.setProperty(key, path);
}
Ciao,
Carsten
--
Carsten Heyl http://www.pixelboxx.de/
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org