title: Display message on the page using jsp when button is submitted
body: <p>I am working on message page, I have fetched the different part of message from the database and show it in table now when the user clicks on check button it should show him the message in brief. How to implement this please explain in brief.</p>
  
  <p>My coding attempt for this problem:</p>
  
  <pre><code>&lt;form  action="Check Notification.jsp" method="post"&gt;   
      &lt;table&gt;
      &lt;tr&gt;
              &lt;th&gt;From&lt;/th&gt;
          &lt;th&gt;Message&lt;/th&gt;
          &lt;th&gt;Check&lt;/th&gt;
              &lt;th&gt;Delete&lt;/th&gt;
      &lt;/tr&gt;
          &lt;%
              Class.forName(driver).newInstance();
              con = DriverManager.getConnection(url + db, uname, password);
              Statement st = con.createStatement();
              String query = "Select * from push_mail WHERE rec_id='"+adm+"'";
              ResultSet rs=st.executeQuery(query);                  
          %&gt;                     
          &lt;%
              while(rs.next()){
          %&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;%=rs.getString("send_id")%&gt;&lt;/td&gt;
                      &lt;td style="display: none"&gt;
                          &lt;input type="text" name="message" value='&lt;%=rs.getString("m_id")%&gt;' /&gt;
                      &lt;/td&gt;
                      &lt;td&gt;&lt;%=rs.getString("m_sub")%&gt;&lt;br/&gt;&lt;%=rs.getString("date")%&gt;&lt;/td&gt;
                      &lt;td&gt;
                          &lt;input type="submit" name='check' value="Check" onclick="check()"/&gt;
                      &lt;/td&gt;
                      &lt;td&gt;&lt;img alt="Delete" src="images/Delete.jpg" width="30px" height="30px" /&gt;&lt;/td&gt;
  
                 &lt;/tr&gt;
             &lt;%
                  }
             %&gt;        
      &lt;/table&gt;
  &lt;/form&gt; 
  &lt;p &gt;
  &lt;%
      String msgid= request.getParameter("message");
      Class.forName(driver).newInstance();
      con = DriverManager.getConnection(url + db, uname, password);
      Statement st1 = con.createStatement();
      String msg = "Select * from push_mail WHERE m_id='"+msgid+"'";
      ResultSet rs1=st1.executeQuery(msg);                  
      while(rs.next()){
          String msgs=rs.getString("m_message");
          out.println(msgs);
      }
  %&gt;
  
  &lt;/p&gt;
  </code></pre>