简体   繁体   English

如何将JavaScript数组对象从jsp页传递到另一个jsp页或servlet

[英]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. 问题是-我在jsp页面中生成了一个javascript JSON数组(在屏幕截图下方)。 Now i want to send that javascript array object from the current page(JSP) to another page(JSP or servlet). 现在,我想将该JavaScript数组对象从当前页面(JSP)发送到另一个页面(JSP或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. ************更准确地说,****************我有一个涉及JSP和Servlet的项目。 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. 现在有index.jsp,它要求用户上传数据表(excel工作表),通过通过servlet调用/发送文件将文件上传到服务器上。 That servlet then tries to extract the data(rows and columns) and generates a 2D Java array with same dimensions. 然后,该servlet尝试提取数据(行和列)并生成具有相同尺寸的2D Java数组。 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 ". 然后将此数组发送到JSP页面(output.jsp),该页面将获取此java数组并将其转换为称为“ data ”的JavaScript JSON数组。 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. 我想要的是-我想将该数据数组对象发送到另一个jsp页面,在这里我可以将其转换为Java Array以便进一步使用。

you can probably save java script array object as a session attribute & get that in another JSP. 您可能可以将Java脚本数组对象另存为会话属性,并在另一个JSP中获得它。

session.setAttribute("Object",object)


session.getAttribute("Object",object)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将变量从javascript传递到另一个jsp页面? - How to pass a variable from javascript to another jsp page? 如何传递一个复选框值数组从一个JSP页面到另一个JSP页面 - How to pass an array of checkbox value From one JSP page to another 如何将日期ID从一个JSP传递到另一个JSP页面 - How to pass date id from one jsp to another jsp page 将数据从一个jsp页面传递到另一个jsp页面 - Pass Data from one jsp page to another jsp page 如何将 jsp 页面中的值传递到 javascript 页面? - How can I pass a value from a jsp page to a javascript page? 如何将jsp页面中的javascript变量传递给另一个java文件? - How to pass javascript variable in jsp page to another java file? 如何将json对象从jsp页面的jsp部分传递到javascript部分,即从服务器端到客户端? - How to pass a json object from the jsp part of a jsp page to the javascript part i.e from server side to client side? 如何将值从Spring Controller传递到jsp页面?(传递的值将用于初始化jsp页面中的javascript变量 - How to pass values from Spring Controller to jsp page?( the passed values is to be used to intialise javascript variables in jsp page 如何将jsp中的值从一页传递到另一页 - how to pass values in jsp from one page to another 如何将js变量从jsp页面传递到另一个页面? - How can I pass JS variable from a jsp page to another?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM