You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Claude Brisson <cl...@renegat.net> on 2007/06/27 16:48:04 UTC

Re: Closing script tag creating problems ''

(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


Re: Closing script tag creating problems ''

Posted by Will Glass-Husain <wg...@gmail.com>.
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 <cl...@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