I have 2 JSP pages as below:
projectcategory.jsp
<%
Connection con = DbConnect.connect();
Statement s = con.createStatement();
ResultSet rs = s.executeQuery("select * from projectcategory");
%>
<DIV class="TabbedPanelsContent" align="center">
<TABLE border="1">
<TR>
<TH>CATEGORY ID</TH>
<TH>CATEGORY NAME</TH>
<TH>Edit/Update</TH>
</TR>
<%
while (rs.next()) {
%>
<%String p=rs.getString(1);%>
<TR>
<TD><%=rs.getString(1)%></TD>
<TD><%=rs.getString(2)%></TD>
<TD>
<FORM action="EditPcat.jsp?pcatid=p"><INPUT type="submit"
value='edit/update'></INPUT>
</FORM>
</TD>
</TR>
<%
}
%>
</TABLE>
</DIV>
another is Editpcat.jsp:
</head>
<body>
<%String s=request.getParameter("p"); %>
<form action="ProjCatServlet" method="post">
<div align="right"><a href="projectcategory.jsp">view</a></div>
<fieldset>
<legend>Edit category</legend>
<table cellspacing="2" cellpadding="2" border="0">
<tr>
<td align="left">Category Id</td>
<td><input type="text" name="pcatid" value="<%=s%>" ></td>
</tr>
<tr>
<td align="right">Category Name</td>
<td><input type="text" name="pcatname"></td>
</tr>
<tr>
<td><input type="submit" value="submit"></td>
</tr>
</table>
<input type="hidden" name="FUNCTION_ID" value="UPDATE">
</fieldset>
</form>
How to display value from one JSP page which we get from database in to text box of another JSP?