Sorry, i didn't realize we had not fully covered the functions of
VelocityFormatter in Tools. Looks like we missed some utils for
formatting arrays/vectors too. I'll have to think about where to add
these.
In the meantime, i suppose i would recommend writing a tool or macro
of your own. The code can be copied straight out of VelocityFormatter
or written to suit you. We have typically used a #truncate
velocimacro to do this in our apps:
#macro( truncate $stringVariable $length )
#set( $truncateMe = "$!stringVariable" )
#if( $truncateMe.length() <=
$length)$truncateMe#else$!{truncateMe.substring(0,$length)}...#end##
#end
On 4/23/07, Sebastian Gumpold <[EMAIL PROTECTED]> wrote:
Hi all!
I'm new to Velocity and tried to find a way to limit the length of an
String. The solution I found worked great for my needs:
VelocityFormatter.limitLen().
Much to my regret I noticed that with Velocity 1.5 (and Tools 1.3)
VelocityFormatter got marked as depricated and I didn't find a proper
replacement for this method in any of the both suggested Tools classes
NumberTool and DateTool.
So here's my question: What's the suggested way to handle this: the usage
of other Tools classes? Own code?
Thanks in advance,
Sebastian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]