i think Charles' solution must be used instead

On Птн, 2006-08-25 at 15:35 +0100, Amit Bardhan wrote:

> Try this: -
> <Book>
>         <Title>#if($book.title)$book.title#end</Title>
> </Book>
> 
> 
> Regards
> Amit
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Matjaž Trtnik [mailto:[EMAIL PROTECTED]
> Sent: 25 August 2006 15:27
> To: velocity-user@jakarta.apache.org
> Subject: Returning empy string isead of $bean.property
> 
> 
> Hello!
> 
> Can anyone suggest me how I can solve my problem whish ic as following:
> 
> Say I have template
> 
> <Book>
>         <Title>$book.title</Title>
> </Book>
> 
> I add Book bean to velocity context
> 
> context.put("book", new Book()).
> 
> Now if title is null return XML will be:
> 
> <Book>
>         <Title>$book.title</Title>
> </Book>
> 
> 
> but I would prefer (empty string):
> 
> <Book>
>         <Title></Title>
> </Book>
> 
> 
> Is it possible to do this somewhere in properties or with some kind of 
> event?
> 
> 
> Regards,
> Matjaž
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
Serge Matveenko 
mailto:[EMAIL PROTECTED] 
http://company.i-free.ru 
+7 (911) 777 42 44 
+7 (905) 22 44 386 

"Not only is the universe stranger than we imagine, it is stranger than
we can imagine." 
Sir Arthur Eddington


Reply via email to