title: Jsp login form Mysql
body: <p>I have a login form using a JSP to check a username and password against a MySQL database. When I try to make it login it is meant to forward me to a main menu page. However, all that havens is the page goes blank and the JSP file-name is added to the end of the URL. The JSP is shown below. What am I doing wrong?</p>
  
  <pre><code>&lt;%@ page language ="java" import="java.sql.*" %&gt;
  &lt;%@ page import ="javax.sql.*" %&gt;
  
  &lt;%
  String user=request.getParameter("name");
  String passwrd=request.getParameter("pass");
  
  try{
  
      Class.forName("com.mysql.jdbc.Driver");
      java.sql.Connection con = DriverManager.getConnection("jdbc:mysql://localhost:8080/languagetest", "root", "password");
      Statement st=con.createStatement();
      ResultSet rs=st.executeQuery("select userid,password from Users");
      while(rs.next())
      {
          String userid=rs.getString(1);
          String password=rs.getString(2);
          if(user.equals(userid) &amp;&amp; passwrd.equals(password))
          {
              out.println("welcome");
  
              %&gt;
              &lt;jsp:forward page="Mainmenu.html"/&gt;
          &lt;%}
      }
  }catch(Exception e1)
  {}
  
  %&gt;
  </code></pre>