简体   繁体   中英

how to pass a javascript array object from a jsp page to another jsp page or servlets

The Problem is - i have generated a javascript JSON array (below screenshot) in a jsp page. Now i want to send that javascript array object from the current page(JSP) to another page(JSP or servlet). Please help. Please provide me the alternative solutions as well which will work best.

JSON Array屏幕截图

************ To be more precise ***************** I am having a project which involves JSP and Servlets. Now there is index.jsp which asks a user to upload data sheet(excel sheet), the file is uploaded on the server by calling/sending the file through a servlet. That servlet then tries to extract the data(rows and columns) and generates a 2D Java array with same dimensions. This array is then sent to a JSP page (output.jsp) which gets this java array and converts it to JavaScript JSON array called as " data ". I am performing some edit operations on this page and the changes gets affected in array accordingly. What i want is - I want to send that data array object to another jsp page where i can convert it into Java Array for further use.

you can probably save java script array object as a session attribute & get that in another JSP.

session.setAttribute("Object",object)


session.getAttribute("Object",object)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM