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