velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stan Devyatovsky <s...@devyatovsky.com>
Subject Re[2]: Custom Resource Loader
Date Mon, 13 Dec 2004 16:44:40 GMT
Hello Will,

 Thanks Will, I guess that's what I needed!
WGH> You can specify locale related info in custom properties.  See this example 
WGH> how the FTP username and password is set for the resource loader.
WGH> http://wiki.apache.org/jakarta-velocity/HackingVelocity

WGH> There's also a patch in Bugzilla (not yet committed) that would allow you to 
WGH> create an instance of a resource loader, programatically configure it, then 
WGH> pass it into Velocity.  This would allow Inversion of Control type setup.
WGH> http://issues.apache.org/bugzilla/show_bug.cgi?id=28611


WGH> WILL

WGH> ----- Original Message ----- 
WGH> From: "Stan Devyatovsky" <stan@devyatovsky.com>
WGH> To: "Velocity Users List" <velocity-user@jakarta.apache.org>
WGH> Sent: Monday, December 13, 2004 4:05 AM
WGH> Subject: Custom Resource Loader


>> 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
>> 


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




-- 
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