Or write a ReferenceInsertionEventHandler to automatically escape all references.

http://wiki.apache.org/jakarta-velocity/HackingVelocity

WILL

----- Original Message ----- From: "Shinobu Kawai Yoshida" <[EMAIL PROTECTED]>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Tuesday, January 25, 2005 4:34 PM
Subject: Re: HTML-escaping variables?



Hi Andreas,

what's the best way to HTML-escape variables, preventing issues when I
code $output and output in fact contains HTML tags (<b>hello world</b>
should NOT be printed in bold but appear as it appears in this text)?

In JSP ${output} and <c:out value="${output}"/> is automatically
escaped; how can I handle this with Velocity?

You can use the EscapeTool. :) $esc.html($output) http://wiki.apache.org/jakarta-velocity/EscapeTool

Best regards,
-- Shinobu

--
Shinobu "Kawai" Yoshida <[EMAIL PROTECTED]>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to