You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Arora <to...@gmail.com> on 2007/06/27 09:36:40 UTC

Closing script tag creating problems ''

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
-- 
View this message in context: http://www.nabble.com/Closing-script-tag-creating-problems-%27%3C-script%3E%27-tf3986758.html#a11319827
Sent from the Velocity - Dev mailing list archive at Nabble.com.

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

Re: Closing script tag creating problems ''

Posted by Claude Brisson <cl...@renegat.net>.
(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