posted 20 years ago
I have an application where
1) Objects are added in JavaScript Array.
2) After form submission, this Array needs to be accessed in Java and the contents of the Array needs to be read in Java class.
3) The GUI user can use ","(comma) while providing the input. Therefore I cannot separate the elements in Array using ","(comma) as delimiter in Java class.
Is there a way to assign the value in JavaScript variable to a Java Variable in the JSP and then pass this Java variable to Java class, instead of JavaScript Array.
e.g.
var arrType= new Array();
for( i = 1; i < document.all.tblContent.rows.length; i++)
{
arrType[i-1] = document.all.tblContent.rows[i].cells[1].innerText;
}
Now, this "document.all.tblContent.rows[i].cells[1].innerText" can contain any character.
So, if I pass the "arrType" to Java Class, how can I separate out the elements in arrType inside Java class.