velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Siefert <siefert.da...@gmail.com>
Subject equality of Long object in template (velocity-1.3)
Date Thu, 26 Aug 2010 19:24:40 GMT
Hi All-

I'm using velocity 1.3 and am generating some text from a template that has
the following code:

#if ( $model.getCount() == 1 ) ... #end

The model object has method getCount() which returns Long (the primitive
wrapper object).  It seems this comparison is not happening correctly as the
"..." text is not included in the output.  I've also tried the following:

#if ( $model.getCount() == "1" ) ... #end

and

#if ( $model.getCount() == '1' ) ... #end

thinking that it might be calling toString on the Long object itself, but
this does not work either.  I've confirmed $model.getCount() on a line by
itself outputs the single '1' character in the generated text.

What would I need to do to get this conditional working?

Thanks,
David

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message