velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr. <ge...@adeptra.com>
Subject Re: One Question
Date Sat, 23 Aug 2003 14:45:19 GMT

On Tuesday, August 19, 2003, at 01:03 PM, Jose Luiz Juniot wrote:

> I really love Velocity, but one thing every worry me.
>
> Why not can I load template by your full location?
>
>
> Like:
>
> Velocity.getTemplate(new 
> File("/anything/something/mylittletemplate.vm"));
>
> or
>
> Velocity.getTemplate(new File("c:\\something\\mytemplate.vm"));
>
> or
>
> Velocity.getTemplate(new File("d:\\anything\\thetemplate.vm"));
>
>
>
> I do not use Velocity only with Servlet. I use with regular 
> application.

Right - the simple answer is that we made the choice in the 
FileResourceLoader to not allow direct access to resources, but make it 
relative.  I don't think it's worth debating the merits of this as it 
is done :)

However,  I certainly understand your concern about using Velocity 
outside of the servlet environment.  I use it outside of servlets as 
well for a significant amount of use.  To that end, I do a few things, 
such as set "/" as the root for file loading, or use the helper methods 
in VelocityEngine, and just feed it a Reader of my file content...

geir

>
> Thanks
> José Luiz Junior
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-956-2604(w)
Adeptra, Inc.                                       203-434-2093(m)
geirm@adeptra.com                                   203-247-1713(m)


Mime
View raw message