docs: protected void processRequest(HttpServletRequest request,
              HttpServletResponse response) throws ServletException, IOException {
  
          //get user's credentials from the request
          String uname = request.getParameter("j_username");
          String pass = request.getParameter("j_password");
  
          try {
              //validate given user using container's login mechanism
              request.login(uname, pass);
  
              ServletContext context = getServletConfig().getServletContext();
              
              //put user's credentials in the servlet context
              context.setAttribute("uname", uname);
              context.setAttribute("password", pass);
              
              //forward request to the initial page
              response.sendRedirect(request.getContextPath() + "/Console.html");
          } catch (ServletException e) {
              //login failed to forward user to the login form
              response.sendRedirect(request.getContextPath() + "/loginform.html");
          }
      }