velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: Escaping double quote characters during variable substitution?
Date Mon, 24 Apr 2006 17:04:25 GMT
In the latest unreleased version in source control, there's are event
handlers to escape HTML, Javascript, etc.  I should have docs posted
in the next day or so.

WILL

On 4/24/06, Joe Desbonnet <jdesbonnet@gmail.com> wrote:
> I've forms with velocity lines like this:
>
> <input type="text" name="myparam" value="$myBean.getName()" />
>
> Occasionally myParamValue will contain a double quote character which
> causes HTML parsing problems. I could of course define some object
> with a filter method and include it in the velocity context ... eg:
>
> <input type="text" name="myparam"
> value="$filterObject.escapeQuotes($myBean.getName())" />
>
> but this is rather messy.
>
> Is there a way to put all variable substitutions through a filter? Or
> any other elegant solutions?
>
> Thanks,
> Joe.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>


--
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

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


Mime
View raw message