velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Kischuk <>
Subject RE: Macro not evaluating
Date Wed, 14 Jul 2004 16:31:49 GMT
Good call - it wasn't the capitalization... that was a typo on my part as I
snipped my code for mailing list consumption.

I think the problem is actually the argument type.  Quantity is actually an
Integer, so I'm calling for (Integer, int), but the method is written as
(String, int).

Thanks for the help.  Is there are reason that Velocity dies so silently,
without even a log message when it can't evaluate an expression?


-----Original Message-----
From: Nathan Bubna [] 
Sent: Wednesday, July 14, 2004 11:17 AM
To: Velocity Users List
Subject: Re: Macro not evaluating

Rob Kischuk said:
>   public String leftPad(String string, int width) {

note the capitalization
> And have defined macros in my template:
> #macro(leftpad $message)
>   ${formatter.leftpad($message, 8)}
> #end

note the capitalization.

> Strangely, the #currency macro fully executes, but the #leftpad macro
> $formatter.leftpad($orderLine.quantity, 8) after the template has been
> processed.  Is there something I'm doing wrong here?

it looks mismatched capitalization.  if not (and that typo is only in this
email), then you might double check that $orderLine.quantity is actually
returning a string.

> And is there a different way I should be doing this?

apart from the capitalization typo, it looks like a good pattern.

Nathan Bubna

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message