You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jeff Harrington <je...@MIT.EDU> on 2003/07/17 16:27:41 UTC

Calling evaluate from a template?

hi,
   Is it possible to somehow call evaluate from inside a template?  The 
reason I ask is:
We have a generic getContext() method which creates the context and stuffs 
some global variables into the context including the parse of a nav.xml 
file which is used to define the contents of the right hand menu. I'd like 
to make the right hand menu be more dynamic by imbedding velocity 
"placeholders"  in the xml file something like:
   <section
     name="Go Some Place Great"
     url="someUrl$somePrefix"
   />
   Prior to merging the template, a servlet would put ("somePrefix", 
"someValue") into the context and when the template is 
rendered   $section.url would be replaced by the someUrlsomeValue but what 
I'm getting is someUrl$somePrefix.

I need a way to force Velocity into reevaluating the string. Is there a way 
to do this? I hope I didn't miss  something obvious.
thanks,
Jeff


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


Re: Calling evaluate from a template?

Posted by Jeff Harrington <je...@MIT.EDU>.
hi,
   The announcement of velocity tools answered my question.
sorry,
Jeff
At 10:27 AM 7/17/2003 -0400, you wrote:
>hi,
>   Is it possible to somehow call evaluate from inside a template?  The 
> reason I ask is:
>We have a generic getContext() method which creates the context and stuffs 
>some global variables into the context including the parse of a nav.xml 
>file which is used to define the contents of the right hand menu. I'd like 
>to make the right hand menu be more dynamic by imbedding velocity 
>"placeholders"  in the xml file something like:
>   <section
>     name="Go Some Place Great"
>     url="someUrl$somePrefix"
>   />
>   Prior to merging the template, a servlet would put ("somePrefix", 
> "someValue") into the context and when the template is 
> rendered   $section.url would be replaced by the someUrlsomeValue but 
> what I'm getting is someUrl$somePrefix.
>
>I need a way to force Velocity into reevaluating the string. Is there a 
>way to do this? I hope I didn't miss  something obvious.
>thanks,
>Jeff
>
>
>---------------------------------------------------------------------
>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