velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <mkien...@alaska.net>
Subject EscapeTool (and velocity-tool best practices)
Date Wed, 08 Dec 2004 20:21:34 GMT
I started using EscapeTool today (since it was far more comprehensive that my 
primitive and misnamed URLEncoder tool), and noticed that it only took 
String arguments.

So if I had did $esc.html($value) and value wasn't a String, I got 
'$esc.html($value)' returned as a literal.

In general, should Velocity tools that operate on a String operate on an 
Object instead and perform a object.toString() conversion first?  Or at 
least provide Object argument wrapper methods to call the String argument 
methods?

Obviously, I can easily subclass EscapeTool even if no one else agrees with 
me and add "public String html(Object object)"-like methods, but I'm curious 
what we consider to be best-practices....

-Mike


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