code: private String getLoginURL(JaspiRequest jaspiRequest, HttpServletRequest req) {
          String loginURL = null;
          LoginConfiguration loginConfig = jaspiRequest.getLoginConfig();
          if (loginConfig != null) {
              FormLoginConfiguration formLoginConfig = loginConfig.getFormLoginConfiguration();
              if (formLoginConfig != null) {
                  String formLoginPageURL = formLoginConfig.getLoginPage();
                  StringBuilder builder = new StringBuilder(req.getRequestURL());
                  if (tc.isDebugEnabled())
                      Tr.debug(tc, "getFormURL", new Object[] { "formLoginPageURL=" + formLoginPageURL, " requestURL=" + builder });
                  int hostIndex = builder.indexOf("//");
                  int contextIndex = builder.indexOf("/", hostIndex + 2);
                  builder.replace(contextIndex, builder.length(), normalizeURL(formLoginPageURL, req.getContextPath()));
                  loginURL = builder.toString();
              }
          }
          return loginURL;
      }
docs: TODO find a good home somewhere