if (!validateParameters(req)) { req.setAttribute("errorMessage", "Please enter your username and password"); req.getRequestDispatcher("/login.jsp").forward(req, res); return; } // authenticate user
String username = req.getParameter("username"); String password = req.getParameter("password"); if ((username == null || "".equals(username)) || (password == null || "".equals(password))) { return false; } else { return true; }