如何将隐藏字段中的数据从一个jsp页面传递到另一个jsp页面?
我在jsp页面的一个隐藏字段中有一些数据如何将隐藏字段中的数据从一个jsp页面传递到另一个jsp页面?,jsp,hidden-field,Jsp,Hidden Field,我在jsp页面的一个隐藏字段中有一些数据 <input type=hidden id="thisField" name="inputName"> 如何在提交到另一页时访问或传递此字段?要传递值,必须在语句中包含隐藏值value=“hiddenValue”,如下所示: <input type="hidden" id="thisField" name="inputName" value="hiddenValue"> 上述脚本的输出将是: The Hidden Valu
<input type=hidden id="thisField" name="inputName">
如何在提交到另一页时访问或传递此字段?要传递值,必须在
语句中包含隐藏值value=“hiddenValue”
,如下所示:
<input type="hidden" id="thisField" name="inputName" value="hiddenValue">
上述脚本的输出将是:
The Hidden Value is hiddenValue
Alex的代码非常有效。请注意,当使用request.getParameter时,必须使用请求调度器
//Pass results back to the client
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("TestPages/ServiceServlet.jsp");
dispatcher.forward(request, response);
The Hidden Value is hiddenValue
//Pass results back to the client
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("TestPages/ServiceServlet.jsp");
dispatcher.forward(request, response);