I am trying to set session attribute in a jsp function. The function reads cell data from a table row and stores it in a variable array. Could you suggest how can I set the array_variable to the session ? My code is as below -
function sendData(recordToSend) { var sessionData = new Array();
var table = document.getElementById("tblReport");
var rowNum = parseInt(recordToSend);
var cells=table.rows[rowNum].cells;
for(var c=1;c<cells.length;c++)
{
sessionData[c-1] = cells[c].innerText;
}
<%
session.setAttribute("tableData",sessionData);// problem is here
%>
}
Thanks for upcoming suggestions.