struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabriel Belingueres" <belingue...@gmail.com>
Subject Re: OGNL and Java Methods String Arguments
Date Thu, 28 Aug 2008 20:07:46 GMT
Have you tried JSTL's replace tag?

http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/replace.fn.html


2008/8/28, Richard Sayre <richardsayre@gmail.com>:
> 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:  #word@java.lang.String@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="#word@java.lang.String@toString()"/>'
>
>
> Here is what I would like to call:
> #word@java.lang.String@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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message