docs: public void doLoginEntry( StaplerRequest req, StaplerResponse rsp ) throws IOException {
          if(req.getUserPrincipal()==null) {
              rsp.sendRedirect2("noPrincipal");
              return;
          }
  
          // TODO fire something in SecurityListener?
  
          String from = req.getParameter("from");
          if(from!=null && from.startsWith("/") && !from.equals("/loginError")) {
              rsp.sendRedirect2(from);    // I'm bit uncomfortable letting users redirected to other sites, make sure the URL falls into this domain
              return;
          }
  
          String url = AbstractProcessingFilter.obtainFullRequestUrl(req);
          if(url!=null) {
              // if the login redirect is initiated by Acegi
              // this should send the user back to where s/he was from.
              rsp.sendRedirect2(url);
              return;
          }
  
          rsp.sendRedirect2(".");
      }