velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wglasshus...@gmail.com>
Subject Re: Closing script tag creating problems '</script>'
Date Wed, 27 Jun 2007 20:13:21 GMT
Velocity 1.5 has event handlers that can be used to automatically escape
references in a variety of formats (HTML, Javascript, etc).  You can specify
which reference it affects via a regular expression.

http://velocity.apache.org/engine/releases/velocity-1.5/developer-guide.html#configuring_event_handlers

see
org.apache.velocity.app.event.implement.EscapeJavascriptReference

WILL

On 6/27/07, Claude Brisson <claude@renegat.net> wrote:
> (Please use the user list for such questions)
>
> Is this value enclosed in quotes ?
>
> esc.javascript mainly escape quotes and line-feeds, so
> "$!esc.javascript(...)" should generate a single one-line string.
>
>
>   Claude
>
>
> Le mercredi 27 juin 2007 à 00:36 -0700, Arora a écrit :
> > Hi All,
> >  I am currently facing issue in my HTML+javascript application which use
> > velocity engine because of  tag appears in the saved content. I am
fetching
> > the value from the database and doing $!esc.javascript to it and then
> > setting the value to the html input type='text' . this flow I can not
> > change.
> > please help me to resolve this as we are not escaping the '/' within the
> > engine. I am using velocity 1.5
> >
> > regards
> > Ajay
>
>
> ---------------------------------------------------------------------
> 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message