docs: protected void processRequest( HttpServletRequest request,
                                     HttpServletResponse response ) throws ServletException, IOException {
          String authHeader = ((HttpServletRequest)request).getHeader("Authorization");
          String pathInfo= request.getPathInfo();
          
          Object marker = request.getSession().getAttribute("login-required-marker");
          
          if (marker == null && pathInfo.equals("login.do")) {
              response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
              response.addHeader("WWW-Authenticate", "Basic realm =\"Realm\"");
              request.getSession().setAttribute("login-required-marker", Boolean.FALSE);
              return;
          }
  
          if (pathInfo.equals("login.do")) {
              response.sendRedirect(request.getContextPath() + "/Console.html");
              return;
          }
          
          String url = request.getRequestURI();
          String servletPath = request.getServletPath();
  
          request.getSession(true).setAttribute("initial.uri", url);
          logger.debug("Store requested uri " + url);
          
          String dest = url.substring(0, url.indexOf(servletPath));
          response.sendRedirect(dest);
      }