John Robert wrote:I am not trying to do this
I'm not sure what you mean by that; the article points out why you are getting the results that you are getting. Do you understand
why the view source shows you what it does?
As the article points out, the scriptlet is evaluated on the server long before the page gets sent to the browser where the JavaScript executes. In order to obtain the array data in JavaScript, you need to write the
JSP such that it emits a JavaScript construct that, when evaluated on the client, results in the JavaScript array.
In other words, create markup along the lines of:
By the way, Java scriptlets in JSPs are a thing of the past.
You should be using the JSTL and EL in your JSPs.
And, as this is much more about JSP than it is about JavaScript, it's been moved to the JSP forum.