since you're using a freemarker variable why not use j_string to insert into
string literal ..the example
<#assign user = "Big Joe's \"right hand\"">
<script>
alert("Welcome ${user?js+string}!");
</script>
outputs
<script>
alert("Welcome Big Joe\'s \"right hand\"!");
</script>
http://freemarker.sourceforge.net/docs/ref_builtins_string.html
?
Martin
_________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business
of Sender. This transmission is of a confidential nature and Sender does not
endorse distribution to any party other than intended recipient. Sender does
not necessarily endorse content contained within this transmission.
> To: [email protected]
> From: [EMAIL PROTECTED]
> Subject: Re: OGNL and Java Methods String Arguments
> Date: Thu, 28 Aug 2008 15:10:19 -0400
>
> Wouldn't <s:property value="#word" escape="true"/> do what you need?
>
> L.
>
> Richard Sayre wrote:
> > I'm trying to call the String replace method from OGNL. I can't find
> > any specific examples on how to do this.
> >
> > I tried the following as a test: [EMAIL PROTECTED]@toString()
> >
> > This worked ok. My problem is I don't know how to pass string
> > literals to the method.
> >
> > Here is my current code:
> > <s:property value="[EMAIL PROTECTED]@toString()"/>'
> >
> >
> > Here is what I would like to call:
> > [EMAIL PROTECTED]@replaceAll("'",
> > Matcher.quoteReplacement("\\'"))
> >
> > (I am replacing a single quite with the JavaScript escape character
> > for single quote \')
> >
> > If some one can help me out or point me to some good examples that
> > would be great.
> >
> > Thank you,
> >
> > Rich
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
_________________________________________________________________
Talk to your Yahoo! Friends via Windows Live Messenger. Find out how.
http://www.windowslive.com/explore/messenger?ocid=TXT_TAGLM_WL_messenger_yahoo_082008