Automatic generation of JavaScript in JSP prints quote in ASCII inside html

Hi,

I generate a string in Struts Action class.

For eg like this. String var ="var a = new Array(["A", "B"]);" ; and pass this string in request object. The string is properly escaped and generated perfectly.

and in JSP

use

<script type="text/javascript" language="javascript">

<c:out value="${var}" />

</script>

In my html, the output is fine, except that double quotes are printed as their equivalent ASCII code.....&#034

How to print this as character itself?

Thanks in advance

[575 byte] By [saracgia] at [2007-11-27 8:51:57]
# 1
Try javascript escape
skp71a at 2007-7-12 21:06:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
In struts my string pritns like this var abc = new Array(["A", "B"]);I pass this string to JSP. and in the outputted html, all double quotes are replaces by its equivalent ASCII ":(
saracgia at 2007-7-12 21:06:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
JavaScript escape doesn't help.... still same problem
saracgia at 2007-7-12 21:06:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
solved it<c:out value="${var}" escapeXml="false" />escapeXml="false" attribute makes the difference. By default its true
saracgia at 2007-7-12 21:06:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
What about trim fn?function trim(stringToTrim) {return stringToTrim.replace(/^\s+|\s+$/g,"");}
skp71a at 2007-7-12 21:06:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...