velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Desbonnet" <jdesbon...@gmail.com>
Subject Escaping double quote characters during variable substitution?
Date Mon, 24 Apr 2006 16:38:10 GMT
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


Mime
View raw message