velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: macros parameter type checking
Date Sun, 28 Jun 2009 00:07:11 GMT
#if( $foo.class.name == "java.lang.Integer" )

or just don't give your macro to an untrusted user.  or if you can at
least trust the user to pass a number, then $foo.intValue() is all you
need.

On Fri, Jun 26, 2009 at 10:52 AM, ChadDavis<chadmichaeldavis@gmail.com> wrote:
> I have a macro that takes an integer parameter.  AFAIK, there's no
> support for typing in the Velocity language.  How can I verify that
> the parameter is an integer value before doing my velocity macro
> logic?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message