passing a variable from jsp to javascript

Does anyone know of a tag library or something else which allows one to do the equivalent of:

<jsp2js jspVar="${myJspVar}" jsVar="myJsVar" />

where the result would be a javascript assignment statement in the html which sets myJsVar equal to the value of myJspVar. I know there are some simple solutions for things like strings, ints, etc. but I have some multi-dimensional arrays, and would prefer not to have to code out something like this manually.

[524 byte] By [johnpeeba] at [2007-11-27 10:26:05]
# 1

var jsVariable = '<%= jspvariable %>';

alert(jsVariable);

skp71a at 2007-7-28 17:37:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I'm pretty sure that won't work for arrays, (much less multi-dimensional ones).

EDIT: I did a little more looking and it seems that JSON or DWR will be able to suit my needs fairly well.

johnpeeba at 2007-7-28 17:37:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...