velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stan Devyatovsky <s...@devyatovsky.com>
Subject Custom Resource Loader
Date Mon, 13 Dec 2004 12:05:27 GMT
Hello,

 Why is it not possible to programmatically configure Velocity?
 I mean, why can't I do something like this:
 
 ===
 VelocityEngine engine = new VelocityEngine();
 engine.setResourceLoader(myCustomResourceLoader);
 ===

 The only possible way to specify myCustomResourceLoader is via
 .properties, but this solution doesn't give me enough flexibility.
 For example, myCustomResourceLoader could depend on the Locale like
 this:

 ===
  ResourceLoader myCustomResourceLoader = new
  LocaleAwareFileResourceLoader(locale);
  // this resource loader would try to lookup for localized templates
  // first for the given locale
 ===

 How do I do something like that?
 
-- 
Best regards,
 Stan                          mailto:stan@devyatovsky.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message