Re: Can velocity load a properties file ?

2006-04-23 Thread trad-ex
Hi Will, Thanks a lot for your commentary. I will try to persuade our development team to implement some functionality in helper object in order not to use reflections code. In fact, I hacked (because I don't have priviledge of committing java source) the helper object ($util) to add a few

Re: Can velocity load a properties file ?

2006-04-21 Thread Will Glass-Husain
Hi Trad-Ex, Far be it from me to dictate how to develop your app. But I tend to avoid reflection in Velocity for the following reasons: -- It's a complex syntax, easy to mess up, hard to read, hard to debug. -- There's a much simpler alternative (putting objects and methods directly in the

Re: Can velocity load a properties file ?

2006-04-21 Thread Glenn Holmer
On Friday 21 April 2006 09:38, Will Glass-Husain wrote: Velocity works well as a markup language where text is directly inserted in a template via properties or method calls. Such templates are easy to use and easy to maintain. If you need a scripting or programming language there are much

Re: Can velocity load a properties file ?

2006-04-20 Thread Will Glass-Husain
Ugh. Using reflection in Velocity to create a new class is a pretty messy kludge. Would it be possible just to create a method in $util that loads this, e.g. $util.getPropertyResourceBundle? WILL On 4/20/06, trad-ex [EMAIL PROTECTED] wrote: Hi All, I tried to load property resource

Re: Can velocity load a properties file ?

2006-04-20 Thread Barbara Baughman
You cannot use the #set directive to designate just any kind of JAVA object. See the User Guide for allowable references. I believe the #set directive you have will automatically call the toString method of the class in order to set the variable to a valid reference, but you can check by

Re: Can velocity load a properties file ?

2006-04-20 Thread Will Glass-Husain
Are you sure? I think #set can be used for any class. I've proposed to limit this to prohibit reflection by default (such as what trad-ex is doing), but we haven't applied the patch yet. WILL On 4/20/06, Barbara Baughman [EMAIL PROTECTED] wrote: You cannot use the #set directive to designate

Re: Can velocity load a properties file ?

2006-04-20 Thread trad-ex
Hi Barbara, Hi Will, Thanks a lot for your response. As Will says, #set can make any class objects. In fact, I often make instances of ArrayList, and use them. But I think whether there are tools like org.apache.velocity.tools. struts.MessageTool or not. I will follow Will's advice to implement