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