velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Matveenko <...@i-free.ru>
Subject RE: Returning empty string instead of $bean.property
Date Fri, 25 Aug 2006 14:59:35 GMT
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:Matjaz.Trtnik@genis.si]
> 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: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 

-- 
Serge Matveenko 
mailto:lig@i-free.ru 
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



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message