I am tyring to retrive an array in js, which i put as a request attribute.
i am trying to retirve it in js as follows
the alert gives me 26, which is wierd... am i missing something here?? is this not the way to get an array in js...
any help would be appreciated..
I looked at the source,
it seems like , when i say temp.length it is giving me the length of the string which i think, is the name of the object.
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?
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.
John Robert wrote:It worked, but for this to work, I have to change the array to a String , before i put it in the request scope.
You communicated fine, but the answer is still no. All the JSP does is to create a text buffer (which just happens to be an HTML page) to send to the browser. No Java-ness, or any other server-side language, makes it out of the server. Anything you want to express on the client has to be rendered as part of text markup sent as the response.