velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: Ifnotnull
Date Fri, 06 May 2005 18:40:18 GMT
Hi jeichels,

> I had previously upgraded to 1.5-dev and things are working well with the one email templating
thing I had found help here on.
> 
> Since the upgrade, however, I seem to be getting some RHS of #set statement is null.
things i don't remember getting before.
> 
> I explored a bit and found:  http://wiki.apache.org/jakarta-velocity/CheckingForNull
> 
> I added these to my velocity property file:
>       userdirective = org.apache.velocity.tools.generic.directive.Ifnull
>       userdirective = org.apache.velocity.tools.generic.directive.Ifnotnull

## Wow!  First person I've heard using it!

> And changed my template code as follows:
>         #ifnotnull( $form )
>             #set ($attr = $form.getBean())
>         #end
> 
> And get this error:
> 
> Encountered "#end\r\n" at line 3, column 1. Was expecting one of: "(" ... ... ... ...
"\\\\" ... "\\" ... ... ... "*#" ... "*#" ... ... ... ... ... ... ... ... ... ... ... "{"
... "}" ...
> 
> org.apache.velocity.exception.ParseErrorException: Encountered "#end\r\n" at line 3,
column 1.

The error suggests that you aren't configuring the directive
correctly.  Have you added it to your codebase/classpath?

Best regards,
-- Shinobu

--
Shinobu Kawai <shinobu.kawai@gmail.com>

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