title: How to redirect the user to a new html page through jsp?
body: <p>I have a html page called Login.html which is a simple login page with username and password and a submit button. On click of the submit button a JSP page called Login.jsp is called which checks for the validity of username and password using SQL database.
  The thing i wanted to do is If the USERNAME and PASSWORD are correct i wanted the REDIRECT the user to a new html page called Site.html . But i cant find how to redirect to that page.
  The code of Login.jsp is</p>
  
  <pre><code>  try{
  Connection con=null;
  PreparedStatement stmt = null;
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  con = DriverManager.getConnection("jdbc:odbc:base","root","root");
  
  String username= request.getParameter("uname");
  String password= request.getParameter("pass");
  String query = "SELECT * FROM users where uname=? AND pass=?";
  stmt=con.prepareStatement(query);
  stmt.setString(1,username);
  stmt.setString(2,password);
  ResultSet rs = stmt.executeQuery();
  
      if(rs.next())
     {
      out.println("Success");&lt;%-- This is where i want to write the redirecting code --%&gt;
     }
     else
     {
    out.println("Fail");
     }
   }
  catch(Exception e)
  {
   out.println(e);
  }
  </code></pre>