title: passing value to a jsp page from a java class using DAO
body: <p>I wanted to pass the value retrieved on a java class to a  page.I am using DAO classes.
  I have retrieved the values from the database and stored them on String variables.Now I want to set them to the text boxes in my view.jsp page.I am new to this area,can anyone help me out??</p>
  
  <p><strong>View.jsp</strong> is as </p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
          pageEncoding="ISO-8859-1"%&gt;
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
      &lt;title&gt;Insert title here&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;form action="process.jsp"&gt;
      Enter Name    &lt;br/&gt; &lt;br&gt; &lt;input type="text" name="uname"  onclick="this.value=''"/&gt;&lt;br/&gt;&lt;br/&gt;
  
      &lt;input type="submit" value="view details"/&gt;&lt;br/&gt;&lt;br/&gt;
      Email id:   &lt;br/&gt; &lt;input type="text"  name="email"  id="email" &gt; &lt;br/&gt;&lt;br/&gt;
      password:   &lt;br/&gt; &lt;input type="text"  name="passw"  id="passw"&gt;&lt;br/&gt;&lt;br/&gt;
  
      &lt;/form&gt;        
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>and My Activity <strong>ViewDAO.java</strong> is as </p>
  
  <pre><code> public static void  view(user u) {
      Connection con=ConnectionProvider.getCon(); 
      String uname=u.getUname();
      try {
          PreparedStatement ps=con.prepareStatement("select email,pass from  S1.USER432 where name='"+uname+"'");
          ResultSet rs = ps.executeQuery();       
  
          while (rs.next()) {
  
              String email = rs.getString("EMAIL");
              String pass = rs.getString("PASS");
  
              }
  
      } catch (SQLException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }       
  
      }
  }
  </code></pre>
  
  <p>Thanks...</p>