JSP将值从表传递到表单

时间:2021-07-06 11:48:54

I have a page with some details of product, i need to edit the current details, so i want to pass these row current values to an edit page when the edit button is clicked. please help

我有一个包含产品细节的页面,我需要编辑当前的详细信息,所以我想在单击编辑按钮时将这些行当前值传递给编辑页面。请帮忙

1 个解决方案

#1


0  

There are 3 Methods to pass values from one jsp to another. With a PathVariable:

将值从一个jsp传递到另一个jsp有3种方法。使用PathVariable:

<a href="site.jsp?var=${var}" />

With a hidden field:

隐藏字段:

<form method="post" action="next.jsp">    
   <input type="hidden" name="var" value="${var}">

Or with a Session object.

或者使用Session对象。

session.setAttribute("var", var);

You can get this with session.getAttribute(var) on the next jsp.

您可以在下一个jsp上使用session.getAttribute(var)获取此信息。

#1


0  

There are 3 Methods to pass values from one jsp to another. With a PathVariable:

将值从一个jsp传递到另一个jsp有3种方法。使用PathVariable:

<a href="site.jsp?var=${var}" />

With a hidden field:

隐藏字段:

<form method="post" action="next.jsp">    
   <input type="hidden" name="var" value="${var}">

Or with a Session object.

或者使用Session对象。

session.setAttribute("var", var);

You can get this with session.getAttribute(var) on the next jsp.

您可以在下一个jsp上使用session.getAttribute(var)获取此信息。