You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by sun davy <aw...@hotmail.com> on 2006/09/11 12:51:43 UTC
i encounter some mistakes in User Guide.
hi Velocity team:
I am an user of Velocity from China. Thanks for your perfect production.
Through your creative and hard work, we have such Convenience and Powerful
tools in our toolbox.
but i have encounter some mistakes in the Velocity User Guide which in
velocity-1.4\docs directory.
1) in Escaping VTL Directives section.
\\#if( $jazz )
Vyacheslav Ganelin
\\#end
In this case, if $jazz is true, the output is
\ Vyacheslav Ganelin
\
after i run this code fragment,the output is :
\ Vyacheslav Ganelin \
i think it's reasonable,because there is no "<br>" tag,so the
browser(my is IE 6.0) doesn't output the backslash in a new line.
2) Advanced Issues: Escaping and !
#set( $foo = "bar" )
$\!foo
$\!{foo}
$\\!foo
$\\\!foo
This renders as:
$!foo
$!{foo}
$\!foo
$\\!foo
My output is:
$!foo
$!{
$\!foo
$\\!foo
i was confused.
-------------------------------------------------------
Contrast this with regular escaping, where \ precedes $:
\$foo
\$!foo
\$!{foo}
\\$!{foo}
This renders as:
\$foo
\$!foo
\$!{foo}
\bar
My output is:
$foo
$!foo
$!{foo}
\bar
it seems like clerical error.
3) Velocimacro Trivia
Currently, Velocimacros must be defined before they are first used in a
template. This means that your #macro() declarations should come before
using the Velocimacros.
i defined VM after they are first used in a template, it also work. i
don't know why.
hope your reply.
best regards
sun wei
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: i encounter some mistakes in User Guide.
Posted by Will Glass-Husain <wg...@forio.com>.
Hi Sun,
Thanks for catching this. Coincidentally someone just reported the
first mistake the other day. We'll work on fixing these.
WILL
On 9/11/06, sun davy <aw...@hotmail.com> wrote:
> hi Velocity team:
> I am an user of Velocity from China. Thanks for your perfect production.
> Through your creative and hard work, we have such Convenience and Powerful
> tools in our toolbox.
> but i have encounter some mistakes in the Velocity User Guide which in
> velocity-1.4\docs directory.
> 1) in Escaping VTL Directives section.
> \\#if( $jazz )
> Vyacheslav Ganelin
> \\#end
>
> In this case, if $jazz is true, the output is
>
> \ Vyacheslav Ganelin
> \
>
> after i run this code fragment,the output is :
> \ Vyacheslav Ganelin \
> i think it's reasonable,because there is no "<br>" tag,so the
> browser(my is IE 6.0) doesn't output the backslash in a new line.
>
> 2) Advanced Issues: Escaping and !
> #set( $foo = "bar" )
> $\!foo
> $\!{foo}
> $\\!foo
> $\\\!foo
>
> This renders as:
> $!foo
> $!{foo}
> $\!foo
> $\\!foo
>
> My output is:
> $!foo
> $!{
> $\!foo
> $\\!foo
> i was confused.
> -------------------------------------------------------
> Contrast this with regular escaping, where \ precedes $:
> \$foo
> \$!foo
> \$!{foo}
> \\$!{foo}
> This renders as:
> \$foo
> \$!foo
> \$!{foo}
> \bar
>
> My output is:
> $foo
> $!foo
> $!{foo}
> \bar
>
> it seems like clerical error.
>
> 3) Velocimacro Trivia
> Currently, Velocimacros must be defined before they are first used in a
> template. This means that your #macro() declarations should come before
> using the Velocimacros.
>
> i defined VM after they are first used in a template, it also work. i
> don't know why.
>
>
> hope your reply.
>
> best regards
>
> sun wei
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
--
Forio Business Simulations
Will Glass-Husain
wglass@forio.com
www.forio.com
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org