I have a Javascript array[arrays[Strings]], which I want to pass to another JSP (cannot use java as the entire logic is written in Javascript and will lead to a humongous amount of rework). The challenge is that the current functionality is using Struts (which I have no experience in) and I couldn’t any useful solution on the net. Any links that can be suggested?
I have to pass the entire object as an array itself and not in any other form.
JSON is a JavaScript object turned to string (serialized) that can be turned into an object again in JAVA. You can POST that string to your JAVA application.
In JavaScript you can turn any object into JSON by using:
You can turn JSON string into an object in JavaScript using:
This won’t work in older IE browsers (I think IE7 and below).
As for parsing JSON strings in Java and turning them into objects; I have no experience with it but you can find some information on that here:
http://json.org/java/