Will Glass-Husain <[EMAIL PROTECTED]> wrote:
> Doesn't quite work that easily.
> 
> The problem is that if "#directive" is not an actual macro, than 
\#directive 
> is shown verbatim.  You only should escape when the same  code is legit in 

> both the source and the generated Velocity.  This can be a little 
confusing.

Now, see, that's exactly the kind of garbage I avoid.  I see now I left off 
another "rule" that I follow.

- Always perform escaping with variable replace (preferrably EscapeTool).

Ie, ${esc.hash} or ${poundSign} and not \#

-Mike


> ----- Original Message ----- 
> From: "Mike Kienenberger" <[EMAIL PROTECTED]>
> To: "Shinobu Kawai" <[EMAIL PROTECTED]>; "Velocity Users List" 
> <velocity-user@jakarta.apache.org>
> Cc: "Velocity Users List" <velocity-user@jakarta.apache.org>
> Sent: Thursday, February 24, 2005 7:07 PM
> Subject: Re: Escaping in VTL (was Re: Velocity JSP Generation)
> 
> 
> > Shinobu Kawai <[EMAIL PROTECTED]> wrote:
> >> > Escaping the VTL properly was a little challenging, but otherwise it 
> >> > was
> > no
> >> > big deal.
> >>
> >> I still don't "get" the whole escaping scheme, partly because I can't
> >> find any documentation that is completely correct.  We might want a
> >> document totally devoted to escaping in VTL.  :(
> >
> > Escape all [$], [#], ["], [!] and ['].  (actually, ! might be overkill, 
> > but
> > better safe than sorry.) Just use your tool :)
> >
> > Always use formal notation ${x}
> >
> > That's always worked for me, and never surprises me.
> >
> > -Mike
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to