title: Java - Retrieving data from Postgresql, show them and edit them
body: <p>Maybe a dumb/newbie question, but I've no idea about how to proceed: I'm implemeting a web phone book, with just name, surname and phone number as inputs.<br>
  At the moment I'm able to perform correctly a query on a postgresql database, with a jsp page that show data in a table. In the same page I've to show a page-link/button/whatever for editing one of the row, but I don't know how to do it; more in detail, I don't know how to select the data that I need to send to an edit jsp page (for example).<br>
  At the moment my (not working) solution is to show data into a form (with data as default input values), and for each row I show a radio button and a submit button: I've tried to set the data as values of the radio button but when I send it to the edit page, the request.getParameter on the radio button fails (null pointer).<br>
  Here some code:</p>
  
  <p>search.jsp (this is how I fill the form)</p>
  
  <pre><code>&lt;tr&gt;
      &lt;td&gt;&lt;input type="text" name="name" value="&lt;%=rs.getString("name")%&gt;"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="surname" value="&lt;%=rs.getString("surname")%&gt;"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="text" name="phone" value="&lt;%=rs.getString("phone")%&gt;"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="radio" name="radio" value="&lt;%=rs.getString("name")%&gt;; &lt;%=rs.getString("surname")%&gt;; &lt;%=rs.getString("phone")%&gt;"&gt;&lt;input type="submit" name="name" value="Edit"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>This is how I try to get radio parameters:</p>
  
  <pre><code>    String radioInput = request.getParameter("radio");
      String[] tmp = radioInput.split("; ");
      String name=tmp[0];
      String surname=tmp[1];
      String phone=tmp[2];
  </code></pre>
  
  <p>I'm quite sure that it is possible to do it with javascript, but I'm not good with it.<br>
  I'm also quite sure that there is a more raffinate solution.<br>
  I wonder if it is possible to scan (in some way) the values of the line in which the radio is checked, to store them in context or in whatever accessible place.</p>
  
  <p>Any help will be really appreciated, thanks. </p>
  
  <p>Marco Dalena</p>