You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Soriano, Jaume" <JS...@es.wanadoo.com> on 2001/09/11 13:18:37 UTC

Templates location problem

Hello, I'm still looking for a solution to this problem:

We want to 'merge' templates which are not located in
the same machine as the one containing our application.

Which ResourceLoader should i configure to be able to
access the templates in this way:
Velocity.mergeTemplate("url_of_my_template/template.vm") ?

Thanks in advance!

========<js...@es.wanadoo.com>=========

Re: Templates location problem

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 9/11/01 1:18 AM, "Soriano, Jaume" <JS...@es.wanadoo.com> wrote:

> Hello, I'm still looking for a solution to this problem:
> 
> We want to 'merge' templates which are not located in
> the same machine as the one containing our application.
> 
> Which ResourceLoader should i configure to be able to
> access the templates in this way:
> Velocity.mergeTemplate("url_of_my_template/template.vm") ?

My personal opinion is that you are flying by the seat of your pants, so to
speak - if something happens to the template serving machine, then your app
goes down.  But I am sure that you have a good reason.

1) You can simply use NFS or samba to mount the remote directory on the
current machine and use the FileResourceLoader to do it.  With windows, just
map the directory to another letter, and add that to the path.  Note that
the FileResourceLoader can have multiple 'nodes' on its search path.  See
the developer docs.

2) You might be able to use the JarResourceLoader and specify a remote jar -
I don't remember if the protocol handler can do this, and will look into it
as it should :)

3) You can just roll your own.  It's easy.

Since I appear to be stuck here until Sunday, I might roll one out for you
to try...

geir

-- 
Geir Magnusson Jr.     geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
If you look up, there are no limits - Japanese Proverb