I don't think that printing the toString of a bidiminsional collection of strings from jsp in the javascript source is a good idea. That's one of the things transport/representational languages have been created for. For this reason, I would suggest to print the JSON representation of that bidimensional collection.
What you need in the JavaScript source code, a bidimensional array of String is:
[["A", "D"], [, "E"], ["B"], [], [], ["C"]]
Notice the double quotes, those are important, without those, the generated javascript array is a bidimensional array of variables (A, D, E, B, C).
For example, using Gson (google json library), in Java I would create
formData like this:
Gson gson = new Gson();
String toPrintInTheJSP = gson.toJson(<your Java bidimensional collection of strings here>);
In the JSP I would output:
var myData = ${formData}; //without the double quotes
var i=0, j=0;
alert(myData[i][j])
If you need to cycle through the collection in JSP (that means while generating the markup (I quote, "I tried assigning formdata to a variable and accessed it using index as below
In JSP: [...]") ), there are different methods to do that, for example a scriptlet or JSTL.
I'm not really sure about what you have to do, the terminology you used in your question is a little bit imprecise. I think you need to cycle in JavaScript on a bidimensional array written by a JSP.
If you have to cycle through the array in JavaScript, you need a nested loop, like this:
var myData = [["A", "D"], [, "E"], ["B"], [], [], ["C"]];
for (var i = 0; i < myData.length; i++){
for(var j = 0; j < myData[i].length; j++){
alert(myData[i][j]);
}
}