You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by mclai <mc...@mail.com> on 2007/08/17 09:28:03 UTC
#evaluate directive
The following code is found in velocity user guide
http://velocity.apache.org/engine/devel/user-guide.html#evaluate
http://velocity.apache.org/engine/devel/user-guide.html#evaluate :
#set($source1 = "abc")
#set($select = "1")
#set($dynamicsource = "$source$select")
#evaluate($dynamicsource)
It is supposed to print "abc" according to the user guide but in fact, the
result to me is that it prints:
#evaluate($source1)
Do I miss something?
I am very new to velocity and I know it is a silly question. Could anyone
kindly tell me why I have different result and how could I correctly use
#evaluate directive to print the right answer?
--
View this message in context: http://www.nabble.com/-evaluate-directive-tf4284105.html#a12195187
Sent from the Velocity - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: #evaluate directive
Posted by Will Glass-Husain <wg...@gmail.com>.
You want to click the link for "Engine 1.5" under Releases (instead of under
Development).
or go directly to:
http://velocity.apache.org/engine/releases/velocity-1.5/developer-guide.html
WILL
On 8/17/07, mclai <mc...@mail.com> wrote:
>
>
> Yes, I am using version 1.5; no wonder I cannot use #evaluate. I am
> reading
> the wrong doc! I don't know that the
> http://http://velocity.apache.org/engine/devel/user-guide.html#evaluate
> online documentation is for version 1.6 specific.
>
>
> Will Glass-Husain-2 wrote:
> >
> > Hii --
> >
> > Just to confirm -- what version of Velocity are you using? #evaluate is
> > in
> > version 1.6, which hasn't yet been released. You can see the docs for
> the
> > latest version 1.5 under the "1.5" link.
> >
> > WILL
> >
> > On 8/17/07, Mhall <mh...@polk.net> wrote:
> >>
> >> Sorry, didn't read your post carefully enough. So the string
> >> "#evaluate($source1)" is being printed? The #evaluate directive isn't
> >> even
> >> being executed?
> >>
> >> -----Original message-----
> >> From: Mhall mhall@polk.net
> >> Date: Fri, 17 Aug 2007 08:07:43 -0400
> >> To: "Velocity Users List" user@velocity.apache.org
> >> Subject: Re: #evaluate directive
> >>
> >> > > #set($dynamicsource = "$source$select")
> >> >
> >> > should be:
> >> >
> >> > > #set($dynamicsource = "$source1$select")
> >> >
> >> >
> >> >
> >> > -----Original message-----
> >> > From: mclai mclai@mail.com
> >> > Date: Fri, 17 Aug 2007 03:01:58 -0400
> >> > To: user@velocity.apache.org
> >> > Subject: #evaluate directive
> >> >
> >> > >
> >> > > The following code is found in velocity user guide
> >> > > http://velocity.apache.org/engine/devel/user-guide.html#evaluate
> >> > > http://velocity.apache.org/engine/devel/user-guide.html#evaluate :
> >> > >
> >> > > #set($source1 = "abc")
> >> > > #set($select = "1")
> >> > > #set($dynamicsource = "$source$select")
> >> > > #evaluate($dynamicsource)
> >> > >
> >> > > It is supposed to print "abc" according to the user guide but in
> >> fact,
> >> the
> >> > > result to me is that it prints:
> >> > > #evaluate($source1)
> >> > >
> >> > > The above code doesn't work for me. Do I miss something?
> >> > >
> >> > > I am very new to velocity and I know it is a silly question. Could
> >> anyone
> >> > > kindly tell me why I have different result and how could I
> correctly
> >> use
> >> > > #evaluate directive to print the right answer?
> >> > >
> >> > >
> >> > > However, if I changed to use ViewRenderTool for VTL evaluation, it
> >> will
> >> > > print "abc" as expected. Is #evaluate no longer to work? I guess
> I
> >> must
> >> > > miss some major steps in order to make #evaluate work. Please post
> >> if
> >> > > someone knows why. Thank you. The following is the working VTL
> >> which
> >> uses
> >> > > $render.eval().
> >> > >
> >> > > #set($source1 = "abc")
> >> > > #set($select = "1")
> >> > > #set($dynamicsource = "$source$select")
> >> > > $render.eval($dynamicsource)
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > View this message in context:
> >> http://www.nabble.com/-evaluate-directive-tf4284105.html#a12195187
> >> > > Sent from the Velocity - User mailing list archive at Nabble.com.
> >> > >
> >> > >
> >> > >
> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> >> > > For additional commands, e-mail: user-help@velocity.apache.org
> >> > >
> >> > >
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> >> > For additional commands, e-mail: user-help@velocity.apache.org
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> >> For additional commands, e-mail: user-help@velocity.apache.org
> >>
> >>
> >
> >
> > --
> > Forio Business Simulations
> >
> > Will Glass-Husain
> > wglass@forio.com
> > www.forio.com
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-evaluate-directive-tf4284105.html#a12200234
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
--
Forio Business Simulations
Will Glass-Husain
wglass@forio.com
www.forio.com
Re: #evaluate directive
Posted by mclai <mc...@mail.com>.
Yes, I am using version 1.5; no wonder I cannot use #evaluate. I am reading
the wrong doc! I don't know that the
http://http://velocity.apache.org/engine/devel/user-guide.html#evaluate
online documentation is for version 1.6 specific.
Will Glass-Husain-2 wrote:
>
> Hii --
>
> Just to confirm -- what version of Velocity are you using? #evaluate is
> in
> version 1.6, which hasn't yet been released. You can see the docs for the
> latest version 1.5 under the "1.5" link.
>
> WILL
>
> On 8/17/07, Mhall <mh...@polk.net> wrote:
>>
>> Sorry, didn't read your post carefully enough. So the string
>> "#evaluate($source1)" is being printed? The #evaluate directive isn't
>> even
>> being executed?
>>
>> -----Original message-----
>> From: Mhall mhall@polk.net
>> Date: Fri, 17 Aug 2007 08:07:43 -0400
>> To: "Velocity Users List" user@velocity.apache.org
>> Subject: Re: #evaluate directive
>>
>> > > #set($dynamicsource = "$source$select")
>> >
>> > should be:
>> >
>> > > #set($dynamicsource = "$source1$select")
>> >
>> >
>> >
>> > -----Original message-----
>> > From: mclai mclai@mail.com
>> > Date: Fri, 17 Aug 2007 03:01:58 -0400
>> > To: user@velocity.apache.org
>> > Subject: #evaluate directive
>> >
>> > >
>> > > The following code is found in velocity user guide
>> > > http://velocity.apache.org/engine/devel/user-guide.html#evaluate
>> > > http://velocity.apache.org/engine/devel/user-guide.html#evaluate :
>> > >
>> > > #set($source1 = "abc")
>> > > #set($select = "1")
>> > > #set($dynamicsource = "$source$select")
>> > > #evaluate($dynamicsource)
>> > >
>> > > It is supposed to print "abc" according to the user guide but in
>> fact,
>> the
>> > > result to me is that it prints:
>> > > #evaluate($source1)
>> > >
>> > > The above code doesn't work for me. Do I miss something?
>> > >
>> > > I am very new to velocity and I know it is a silly question. Could
>> anyone
>> > > kindly tell me why I have different result and how could I correctly
>> use
>> > > #evaluate directive to print the right answer?
>> > >
>> > >
>> > > However, if I changed to use ViewRenderTool for VTL evaluation, it
>> will
>> > > print "abc" as expected. Is #evaluate no longer to work? I guess I
>> must
>> > > miss some major steps in order to make #evaluate work. Please post
>> if
>> > > someone knows why. Thank you. The following is the working VTL
>> which
>> uses
>> > > $render.eval().
>> > >
>> > > #set($source1 = "abc")
>> > > #set($select = "1")
>> > > #set($dynamicsource = "$source$select")
>> > > $render.eval($dynamicsource)
>> > >
>> > >
>> > >
>> > > --
>> > > View this message in context:
>> http://www.nabble.com/-evaluate-directive-tf4284105.html#a12195187
>> > > Sent from the Velocity - User mailing list archive at Nabble.com.
>> > >
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> > > For additional commands, e-mail: user-help@velocity.apache.org
>> > >
>> > >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> > For additional commands, e-mail: user-help@velocity.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> wglass@forio.com
> www.forio.com
>
>
--
View this message in context: http://www.nabble.com/-evaluate-directive-tf4284105.html#a12200234
Sent from the Velocity - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org