I'm not sure if this question would be for the Velocity list or the Turbine
list. I want to have the system look in several different locations for its
templates. Now, I know you can set file.resource.loader.path and have it
look in multiple places.

But the hitch is I want to set the list of paths differently on a
per-request basis. That is, there is something in the request URL (or
possibly the session) that indicates the set of template paths to use. For
example:
- For the URL http://host/app/servlet/app/portal/public, I might want to
look first under /templates/public for the template, then if it's not found
look under /templates/common
- The URL http://host/app/servlet/app/portal/local, however, would result in
looking first under /templates/local then under /templates/common.

I looked at doing something to Velocity's FileResourceLoader, but that
appears to be handled pretty statically; I don't see anything to be able to
change this path on a request-by-request basis. Another possibility would be
to modify the layout to find the templates and then pass the full name to
Velocity (e.g. /templates/public/templatename.vm), perhaps by scanning over
them at startup time and putting the results into a table for easy access. I
guess my questions are (a) does anything handle this already and (b) if not
does my proposed solution sound reasonable.

Thanks,
<>< gary


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to