You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Rafał Gierusz <su...@tlen.pl> on 2005/11/15 15:29:17 UTC
Some errors in tools 1.2
Hello,
I've found some errors in new (1.2) Velocity Tools
1) on page http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/generic/AlternatorTool.html
there is an example:
#set( $color = $alternator.make('red', 'blue') )
## use manual alternation for this one
#set( $style = $alternator.make(false, ['hip','fly','groovy']) )
#foreach( $i in [1..5] )
$i is $color and $style.next
#end
and output:
1 is red and hip
2 is blue and fly
3 is red and groovy
4 is blue and hip
5 is red and fly
the real output is:
1 is red and hip
2 is red and fly
3 is red and groovy
4 is red and hip
5 is red and fly
so, there is error in line firs line of example, should be ("true"
added):
#set( $color = $alternator.make(true, 'red', 'blue') )
2) on page http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/generic/ValueParser.html
there is an example toolbox configuration:
<tool>
<key>parser</key>
<class>org.apache.velocity.generic.Parser</class>
</tool>
should be:
<tool>
<key>parser</key>
<class>org.apache.velocity.tools.generic.ValueParser</class>
</tool>
---
Rafal Gierusz
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: Some errors in tools 1.2
Posted by Nathan Bubna <nb...@gmail.com>.
bummer. too bad one of us didn't spot these earlier. :-/ it's a bit
late to fix those in the docs bundled with the release (i don't think
it's worth a point release just for these), but i'll fix them in our
online docs either this afternoon or tomorrow.
thanks for catching these, Rafal!
On 11/15/05, Rafał Gierusz <su...@tlen.pl> wrote:
> Hello,
>
> I've found some errors in new (1.2) Velocity Tools
>
> 1) on page http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/generic/AlternatorTool.html
> there is an example:
>
> #set( $color = $alternator.make('red', 'blue') )
> ## use manual alternation for this one
> #set( $style = $alternator.make(false, ['hip','fly','groovy']) )
> #foreach( $i in [1..5] )
> $i is $color and $style.next
> #end
>
> and output:
>
> 1 is red and hip
> 2 is blue and fly
> 3 is red and groovy
> 4 is blue and hip
> 5 is red and fly
>
> the real output is:
>
> 1 is red and hip
> 2 is red and fly
> 3 is red and groovy
> 4 is red and hip
> 5 is red and fly
>
> so, there is error in line firs line of example, should be ("true"
> added):
>
> #set( $color = $alternator.make(true, 'red', 'blue') )
>
> 2) on page http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/generic/ValueParser.html
> there is an example toolbox configuration:
>
> <tool>
> <key>parser</key>
> <class>org.apache.velocity.generic.Parser</class>
> </tool>
>
> should be:
>
> <tool>
> <key>parser</key>
> <class>org.apache.velocity.tools.generic.ValueParser</class>
> </tool>
>
> ---
> Rafal Gierusz
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>