« Return to Thread: Java method that generates html tags is encoding angle brackets...

Java method that generates html tags is encoding angle brackets...

by smadirondack :: Rate this Message:

| View in Thread

From a Velocity template I call a java method that generates html tags

 <area shape="rect" href="http://test.com/mylink" />

But it encodes so the page ends up with the following (spaces added).

& l t ;area shape=& quot ;rect & quot; href=& quot;http:.....

Here's part of the template:

#set($myLinks=$reportTool.getImageMapLinks($report))
$myLinks

In the java method I just use StringBuilder with its append method and return the toString like the following:

StringBuilder sb = new StringBuilder();
sb.append("<area shape=\"rect\" href=\"http://test.com/mylink\" />");
return sb.toString();


What can I do so that the generated html is not encoded?

Thanks

 « Return to Thread: Java method that generates html tags is encoding angle brackets...