velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Chodakowski <>
Subject Velocity and subclasses
Date Sun, 08 May 2005 02:12:28 GMT
I have a parsing class with a child subclass that contains any errors 
encountered during processing. The subclass is entirely public, and its 
getter/setter methods are likewise public. After all the discussion in 
the last week of examining for null, I implemented my template as such:

#if (!$PR.Error) N/A
#foreach($Error in $PR.Error)
${Error.FieldName} - ${Error.ErrorString} - ${Error.FieldValue}<br>

$PR.Error is an ArrayList within the parent class that remains null 
until an error is added. The ArrayList contains instances of the child 
subclass. I know via debug logging that $PR.Error is not null so why is 
this this not working. When using approach #1 as described in the wiki, 
if the $PR.Error is null, then the #if (! $PR.Error) should evaluate to 
true, and of course the reverse - that $PR.Error is not null, would be 
played out in the #else.

Any thoughts?


J --

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

View raw message