You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by James Roycroft <ja...@telus.net> on 2003/10/28 05:42:22 UTC

RESOLVED - Re: Anomaly with errorMarkup macro in velstruts example 3 (Related to bug 24133)

You are quite right. It does not display anything when I change it to
'$errors.exist', and I must have missed the ReferenceException warning in
the log file the first time around, but I see it now. Thanks for your help.

----- Original Message ----- 
From: "Nathan Bubna" <na...@esha.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Sunday, October 26, 2003 11:21 PM
Subject: Re: Anomaly with errorMarkup macro in velstruts example 3 (Related
to bug 24133)


> James Roycroft said:
> > I do not understand why it breaks. When I try this out with a much
simpler
> > test case, using '$errors.exist', it works fine. Why would it break in
the
> > example app?
>
> i highly doubt that it does.  have you tried reversing your test macro so
that
> you are testing if errors *do* exist instead of testing if they *don't*?
>
> Velocity's shorthand notation for methods (where you can leave off the
> parentheses) only works for bean-style methods (i.e. methods prefixed by
> "get", "set", or "is") or else values returned by a get(String) method.
>
> in other words, #if( !$errors.exist ) foo #end  will always display ' foo
'
> because there is no isExist(), or getExist() method in the ErrorsTool.
you
> must do $errors.exist().
>
> Nathan Bubna
> nathan@esha.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>


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