title: Get session value from hyperlink and pass it to another page in JSP
body: <p>I have a page which shows a table from backend in the frontend using the  tag.
  Now i have used a while loop to display the no. of rows of the table. In the table there are 3 columns namely "NAME","DATE","CREATED BY". Now i have put the "NAME" column within a  tag to make it a link, so that when the user click a particular name i want that name value to go to another page which i have mentioned within the href="" property of the  tag. I am trying to use session variable to use it, but null value is only getting passed. Here is my code :</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 * from Topic where Status='Approved'");
  
  
         %&gt;&lt;table border="1"  style="table-layout: fixed; width: 500px"  &gt;
                  &lt;tr&gt;
                      &lt;th&gt;Name&lt;/th&gt;
                      &lt;th&gt;Date&lt;/th&gt;
                      &lt;th&gt;Created By&lt;/th&gt;
  
                  &lt;/tr&gt;
                  &lt;%
  
  while(rs.next()){%&gt;
  
                  &lt;tr align="center"&gt;
  
                      &lt;td height="20px"&gt;&lt;a href="topiccomment.jsp"&gt;&lt;%=rs.getString("TName")%&gt;&lt;/a&gt;&lt;/td&gt;
                      &lt;td height="20px"&gt;&lt;%=rs.getString("Date")%&gt;&lt;/td&gt;
                      &lt;td height="20px"&gt;&lt;%=rs.getString("Username")%&gt;&lt;/td&gt;
  
                  &lt;/tr&gt;
  
  
               &lt;%}%&gt;&lt;/table&gt;&lt;br/&gt;&lt;%
  
  }
  catch(Exception e){e.printStackTrace();}
  
  %&gt;
  </code></pre>