Login functionality using Servlet, JSP and JavaScript