Re: What does "Velocimacro with a Body" mean?

"O. Olson" <[email protected]> Thu, 8 Aug 2013 15:48:29 +0100 (BST)
Newsgroups gmane.comp.jakarta.velocity.user
Message-ID <[email protected]>

Thank you very much Erik. (Great to see you here and on the
Solr group.) This is a good tip, because  from it I realized that bodyContent is class
org.apache.velocity.runtime.directive.Block. 
 
So another way to trim from what Alex suggested is:
#macro(my_trim)$!bodyContent.toString().trim()#end
 
Simply doing:
#macro(my_trim)$!bodyContent.trim()#end
 
Does not work.
 
Thanks again,
O. O.


----- Messaggio originale -----
Da: Erik Hatcher <[email protected]>
A: Velocity Users List <[email protected]>; O. Olson <[email protected]>
Cc: Sergiu Dumitriu <[email protected]>; Alex Fedotov <[email protected]>
Inviato: Giovedì 8 Agosto 2013 5:36
Oggetto: Re: What does "Velocimacro with a Body" mean?

One trick I use when confronted with context objects that aren't behaving as I'd expect is to output:

    $object.class

and then it's clear what object type you're dealing with.

    Erik