title: Servlet does not show any error, but also it's not showing any output
body: <p>I'm creating a login page application with JSP servlet and MySQL database. But my application does not show any error.</p>
  
  <pre><code>package controller;
  
  import java.io.IOException;
  import java.sql.Connection;
  import java.sql.DriverManager;
  import java.sql.PreparedStatement;
  import java.sql.ResultSet;
  import java.sql.SQLException;
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  @WebServlet("/LoginController")
  public class LoginController extends HttpServlet {
  
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
          String un=request.getParameter("user");
          String pw=request.getParameter("pass");
  
          // Connect to mysql(mariadb) and verify username password
  
          try {
              Class.forName("com.mysql.jdbc.Driver");
              // loads driver
              Connection c = DriverManager.getConnection("jdbc:mysql://localhost:3306/mylogin?" + "username=root&amp;password="); // gets a new connection
  
              PreparedStatement ps = c.prepareStatement("select usernmae,password from login where username=? and password=?");
              ps.setString(1, un);
              ps.setString(2, pw);
  
              ResultSet rs = ps.executeQuery();
  
              while (rs.next()) {
                  response.sendRedirect("welcome.jsp");
                  return;
              }
              System.out.println("invalid user");
              return;
          } catch (ClassNotFoundException | SQLException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>