Problem in setting session attribute in jsp function -



Problem in setting session attribute in jsp function -

i trying set session attribute in jsp function. function reads cell info table row , stores in variable array. suggest how can set array_variable session ? code 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 here %>

}

thanks upcoming suggestions.

java/jsp , javascript not run in sync you'd expect coding. java/jsp runs @ webserver upon http request , produces html/css/js code sent webbrowser http response. webbrowser retrieves bunch of html/css/js code without single line of java/jsp code.

to point, need allow js (or html form) send http request desired request parameters webserver , hook java (servlet) code on request url can set session attribute based on request parameters. allow javascript fill hidden input values of form , submit it, or send ajax request.

jsp session

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -