You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2002/03/27 04:56:30 UTC

Velocity.templateExists(String) ambiguity

The Velocity.templateExists(String) method documents that it
"determines if a template is accessable via the currently configured
resource loaders".  However, the implementation appears to check for
both ContentResource and Template Resource objects.  This is exatly
what I need for my current use case, but from the documentation and
method signature I couldn't tell that the method provided such lovely
fluff.  I would've just patched the JavaDoc in CVS, but I'm thinking
that it might be better to deprecate the method in favor of a
better-named resourceExists(String) version.  Comments?

- Dan

p.s. I promise not to flog the author.  ;-)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocity.templateExists(String) ambiguity

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Geir Magnusson Jr." <ge...@earthlink.net> writes:

> On 3/27/02 4:14 AM, "Daniel Rall" <dl...@finemaltcoding.com> wrote:
>
>> My use case is for static content -- not a Template, a
>> ContentResource.  I'm using it in conjunction with Apache httpd's
>> MultiViews to #include localized static content from a Velocity
>> template.
>
> Sounds good.  It's more accurate anyway...

Done.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocity.templateExists(String) ambiguity

Posted by "Geir Magnusson Jr." <ge...@earthlink.net>.
On 3/27/02 4:14 AM, "Daniel Rall" <dl...@finemaltcoding.com> wrote:

> "Geir Magnusson Jr." <ge...@earthlink.net> writes:
> 
>> On 3/26/02 10:56 PM, "Daniel Rall" <dl...@finemaltcoding.com> wrote:
>> 
>>> The Velocity.templateExists(String) method documents that it
>>> "determines if a template is accessable via the currently configured
>>> resource loaders".  However, the implementation appears to check for
>>> both ContentResource and Template Resource objects.  This is exatly
>>> what I need for my current use case, but from the documentation and
>>> method signature I couldn't tell that the method provided such lovely
>>> fluff.  I would've just patched the JavaDoc in CVS, but I'm thinking
>>> that it might be better to deprecate the method in favor of a
>>> better-named resourceExists(String) version.  Comments?
>>> 
>>> - Dan
>>> 
>>> p.s. I promise not to flog the author.  ;-)
>> 
>> Sure.
>> 
>> To be pedantic, it is a template. If you render it, that's another story :)
>> 
>> I think your suggestion is fine.  Or the javadoc can just be updated. :)
> 
> My use case is for static content -- not a Template, a
> ContentResource.  I'm using it in conjunction with Apache httpd's
> MultiViews to #include localized static content from a Velocity
> template.

Sounds good.  It's more accurate anyway...

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - Benjamin Franklin



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocity.templateExists(String) ambiguity

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Geir Magnusson Jr." <ge...@earthlink.net> writes:

> On 3/26/02 10:56 PM, "Daniel Rall" <dl...@finemaltcoding.com> wrote:
>
>> The Velocity.templateExists(String) method documents that it
>> "determines if a template is accessable via the currently configured
>> resource loaders".  However, the implementation appears to check for
>> both ContentResource and Template Resource objects.  This is exatly
>> what I need for my current use case, but from the documentation and
>> method signature I couldn't tell that the method provided such lovely
>> fluff.  I would've just patched the JavaDoc in CVS, but I'm thinking
>> that it might be better to deprecate the method in favor of a
>> better-named resourceExists(String) version.  Comments?
>> 
>> - Dan
>> 
>> p.s. I promise not to flog the author.  ;-)
>
> Sure.
>
> To be pedantic, it is a template. If you render it, that's another story :)
>
> I think your suggestion is fine.  Or the javadoc can just be updated. :)

My use case is for static content -- not a Template, a
ContentResource.  I'm using it in conjunction with Apache httpd's
MultiViews to #include localized static content from a Velocity
template.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Velocity.templateExists(String) ambiguity

Posted by "Geir Magnusson Jr." <ge...@earthlink.net>.
On 3/26/02 10:56 PM, "Daniel Rall" <dl...@finemaltcoding.com> wrote:

> The Velocity.templateExists(String) method documents that it
> "determines if a template is accessable via the currently configured
> resource loaders".  However, the implementation appears to check for
> both ContentResource and Template Resource objects.  This is exatly
> what I need for my current use case, but from the documentation and
> method signature I couldn't tell that the method provided such lovely
> fluff.  I would've just patched the JavaDoc in CVS, but I'm thinking
> that it might be better to deprecate the method in favor of a
> better-named resourceExists(String) version.  Comments?
> 
> - Dan
> 
> p.s. I promise not to flog the author.  ;-)

Sure.

To be pedantic, it is a template. If you render it, that's another story :)

I think your suggestion is fine.  Or the javadoc can just be updated. :)

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety." - Benjamin Franklin



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>