velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Attila Szegedi <>
Subject Re: How can a list of available templates be obtained?
Date Sat, 30 Mar 2002 21:19:53 GMT
Given that a class loader can be defined such that it loads dynamically
generated resources, a getResourcePaths() would eventually have to be able
to return an infinite collection.... while this is an extreme case, it is
not disallowed by any specification... What Gear calls "large space" can be
even "infinite space", or "partially unknown space" (take for instance
loading resources over HTTP relative to a base URL - you can't enumerate all
available URLs, at least not in absence of WebDAV).


----- Original Message -----
From: "Ben Peter" <>
To: "Velocity Users List" <>
Sent: Thursday, March 28, 2002 10:58 PM
Subject: Re: How can a list of available templates be obtained?

> Yes, I feared that, and it makes sense. However, it would be nice if
> java.lang.Classloader had something similar to ServletContext's
> getResourcePaths(String path), which gives you all available resources in
> package/directory.
> [snip]
> > What you might do is extend the JarResourceLoader and use the
> > Attributes (see dev guide) feature to allow your app level code to talk
> > the loader.  Then your loader can do fancy things for you and make them
> > available to the app.
> Hm, I'll probably not go that far, as it is only a matter of making
> easier. I'll probably just generate a list of templates at deployment time
> read that from a config file.
> If I find the time, I'll probably look at whether something of general use
> be added to the JarResourceLoader, if that is of any use to others as
> Thanks a lot for your answers.
> > geir
> --
> Benjamin Peter                                          +49-69-96244395
> Application Engineer                             Moerfelder Landstr. 55
> (zentropy:partners)                            60598 Frankfurt, Germany
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message