velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Chodakowski <jas...@hyperworx.com>
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
#else
#foreach($Error in $PR.Error)
${Error.FieldName} - ${Error.ErrorString} - ${Error.FieldValue}<br>
#end
#end

$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?

Thanks,

J --

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


Mime
View raw message