title: How to pass a radio button value of a table from one jsp to another
body: <p>i have a 2 JSP pages
  i.adminhome.jsp
  ii.deletecontroller.jsp</p>
  
  <p>adminhome.jsp shows the client table</p>
  
  <p>i want the admin to delete a specific row from the client table if he so desires.
  so i need to use a radiobutton to select the clientid from the client table, and press the "Delete" button to delete that selected row</p>
  
  <p>But i am not getting the desired output as i am failing to pass the selected clientid value to the deletecontroller page as a session variable. Thus i am getting null value.</p>
  
  <p>These are the codes of the 2 pages</p>
  
  <p>1.adminhome.jsp</p>
  
  <pre><code>&lt;%
  try
  {
  Connection conn=null;
  Statement stmt=null;
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  conn=DriverManager.getConnection("jdbc:odbc:xyz","sa","pass");
  stmt = conn.createStatement();
  ResultSet rs = stmt.executeQuery("Select UserID,Username,Location,Gender,EmailID from Client");
  
  while(rs.next()){%&gt;
  
  
  &lt;table border="1" align="center" &gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input name="district" type="radio"  value="&lt;%=rs.getString("UserID") %&gt;" required="true"/&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%=rs.getString("Username") %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%=rs.getString("Location") %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%=rs.getString("Gender") %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%=rs.getString("EmailID") %&gt;&lt;/td&gt;
  
  
          &lt;%  
              String x = request.getParameter("district");
              session.setAttribute("userid", x);
          %&gt;
  
  
  
  
          &lt;td&gt;&lt;input type="submit" name="btn1" value="Delete"&gt;&lt;/td&gt;
  
      &lt;/tr&gt;
  &lt;/table&gt;
  
          &lt;/div&gt;
  
          &lt;br/&gt;&lt;br/&gt;
  
  
  
  &lt;%}
  }
  catch(Exception e){e.printStackTrace();}
  
  %&gt;&lt;/form&gt;
  </code></pre>
  
  <p>2.deletecontroller.jsp</p>
  
  <pre><code>&lt;%@ page import="java.util.*" %&gt;
  &lt;%@ page language="java" import="java.sql.*" errorPage="" %&gt;
  &lt;%
      String x=session.getAttribute( "userid" ).toString();
      Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
      Connection con = DriverManager.getConnection("jdbc:odbc:xyz;","sa","pass");
  
      Statement stmt=null;
      stmt = con.createStatement();
  
      String del="Delete from Client where UserID='"+x+"' ";
      stmt.executeUpdate(del);
  
      response.sendRedirect("index.jsp");
  
  
  
  %&gt;
  </code></pre>