Originally posted by Scott Selikoff:
Then, anywhere in the javascript, just call myJavaScriptVariable and if the page is finished loading, the variable will be available.
That's only going to work for very basic value. In general you need to escape you Java variable before assigning its value to the javascript var. Don't forget that the assignment happens by literally printing the Java var's value to the page.
As a starting point you could use the following code:
then in your bean, do something like:
and finally, on the JSP page:
of course, for numbers you don't use the single quotes.