velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duttaroy, Debasish" <>
Subject How to use EscapeTool
Date Tue, 29 Aug 2006 20:26:57 GMT
I am new to Velocity. Here is my requirement.

I want the velocity template to spit out a xml output. Basically, my .vm
file is a xml template. I am able to achieve this. Now I want the data
inside this xml document to be escaped.

What is the best way to do this.

My understanding is this should be done with the help of EscapeTool.
BTW, I use Spring MVC. This is what I do:

My hello.vm

## Velocity Hello World
<?xml version="1.0"?>

Required output

		<headlinetext>Times &amp; Warner</headlinetext>

Actual Output

		<headlinetext>Times & Warner</headlinetext>

I put toolbox.xml inside WEB-INF

<?xml version="1.0"?>

What else do I need to do. If anyone can provide a step by step method
to best way of doing escaping that will be great. I can achieve what I
want by some crude means, but I want the best practice not the hack.

Thanks in advance

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message