The redirect location is specified as <code>logoutRedirect.root</code> in the Spring
environment.

@return The redirection URL
519043
private String selectRedirectionUrl(HttpServletRequest request) {

        final String defaultRedirect = request.getContextPath() + "/";

        String rslt = null; // default

        // Get the person object associated with the request
        final IPerson person = this.personManager.getPerson(request);
        final String username = person != null ? person.getUserName() : "[unavailable]";

        if (person != null) {
            // Analyze the user's authentication status
            final ISecurityContext securityContext = person.getSecurityContext();
            if (securityContext.isAuthenticated() && StringUtils.isNotBlank(logoutRedirect)) {
                rslt = logoutRedirect;
            }
        }

        // Otherwise use a sensible default...
        rslt =
                rslt != null
                        ? urlCustomizer.customizeUrl(request, rslt)
                        : urlCustomizer.customizeUrl(request, defaultRedirect);

        logger.debug("Calculated redirectionURL='{}' for user='{}'", rslt, username);

        return rslt;
    }
135338
public static String getTargetUrl() {
		String targetUrl = System.getenv(ENV_API_URL_KEY);
		if (targetUrl != null) {
			return targetUrl;
		} else {
			targetUrl = apiUrl;
		}
		return targetUrl;
	}
15555
public Location getLocationAtEntry() {
        InstructionHandle handle = getEntry().getFirstInstruction();
        assert handle != null;
        return new Location(handle, getEntry());
    }
1329892
public static String getRootClassPath() {
		if (rootClassPath == null) {
			try {
				// String path = PathKit.class.getClassLoader().getResource("").toURI().getPath();
				String path = getClassLoader().getResource("").toURI().getPath();
				rootClassPath = new File(path).getAbsolutePath();
			}
			catch (Exception e) {
				// String path = PathKit.class.getClassLoader().getResource("").getPath();
				// String path = getClassLoader().getResource("").getPath();
				// rootClassPath = new File(path).getAbsolutePath();
				
				try {
					String path = PathKit.class.getProtectionDomain().getCodeSource().getLocation().getPath();
					path = java.net.URLDecoder.decode(path, "UTF-8");
					if (path.endsWith(File.separator)) {
						path = path.substring(0, path.length() - 1);
					}
					rootClassPath = path;
				} catch (UnsupportedEncodingException e1) {
					throw new RuntimeException(e1);
				}
			}
		}
		return rootClassPath;
	}
329627
protected function getRedirectUrl()
    {
        $url = $this->redirector->getUrlGenerator();

        if ($this->redirect) {
            return $url->to($this->redirect);
        } elseif ($this->redirectRoute) {
            return $url->route($this->redirectRoute);
        } elseif ($this->redirectAction) {
            return $url->action($this->redirectAction);
        }

        return $url->previous();
    }
579341
protected URI determineUnauthorizedServiceRedirectUrl(final RequestContext context) {
        val redirectUrl = WebUtils.getUnauthorizedRedirectUrlFromFlowScope(context);
        val currentEvent = context.getCurrentEvent();
        val eventAttributes = currentEvent.getAttributes();
        LOGGER.debug("Finalizing the unauthorized redirect URL [{}] when processing event [{}] with attributes [{}]",
            redirectUrl, currentEvent.getId(), eventAttributes);
        return redirectUrl;
    }
675469
public FacesConfigRedirectRedirectParamType<FacesConfigRedirectType<T>> getOrCreateRedirectParam()
   {
      List<Node> nodeList = childNode.get("redirect-param");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigRedirectRedirectParamTypeImpl<FacesConfigRedirectType<T>>(this, "redirect-param", childNode, nodeList.get(0));
      }
      return createRedirectParam();
   }
447521
protected String inferRootUrl() {
        if (isProtocolEnabled("https")) {
            Integer port = getHttpsPort();
            checkNotNull(port, "HTTPS_PORT sensors not set; is an acceptable port available?");
            return String.format("https://%s:%s/", getHostname(), port);
        } else if (isProtocolEnabled("http")) {
            Integer port = getHttpPort();
            checkNotNull(port, "HTTP_PORT sensors not set; is an acceptable port available?");
            return String.format("http://%s:%s/", getHostname(), port);
        } else {
            throw new IllegalStateException("HTTP and HTTPS protocols not enabled for " + entity + "; enabled protocols are " + getEnabledProtocols());
        }
    }
637634
protected String getRemoteAddress() {
        String ipAddress = this.response.getRequest().getHeader("x-forwarded-for");
        if (ipAddress == null) {
            ipAddress = this.response.getRequest().getHeader("X_FORWARDED_FOR");
            if (ipAddress == null){
                ipAddress = this.response.getRequest().getRemoteAddr();
            }
        }
        return this.response.getRequest().getScheme() + "://" + ipAddress;
    }
1039065
public String getMetaRedirect()
    {
        if (this.getProperty(XMLTags.META_REDIRECT) != null)
            return this.getProperty(XMLTags.META_REDIRECT);
        return DBConstants.BLANK;  // Override this
    }
1068446
@Override
    public AuthenticationStatus redirect(String location) {
        try {
            response.sendRedirect(response.encodeURL(location));
            response.setStatus(HttpServletResponse.SC_FOUND);
        } catch (IOException e) {
            // TODO: Determine if this needs a serviceability message
        }
        return AuthenticationStatus.SEND_CONTINUE;
    }
402879
public String getUrl() {
        if (url == null) {
            RequestHandle request = getRequest();
            url = LinkUtil.getUrl(request, getPath(), request.getSelectors(), null);
        }
        return url;
    }
1007888
@Override
    public void setRedirectLocation(String location, String renderUrlParamName) {
        this.location = location;
        this.renderUrlParamName = renderUrlParamName;
    }
1343087
private String getRedirectUrl(RequestParametersHolder requestHolder) throws AlipayApiException {
        StringBuffer urlSb = new StringBuffer(serverUrl);
        try {
            Map<String, String> sortedMap = AlipaySignature.getSortedMap(requestHolder);
            String sortedQuery = WebUtils.buildQuery(sortedMap, charset);
            urlSb.append("?");
            urlSb.append(sortedQuery);
        } catch (IOException e) {
            throw new AlipayApiException(e);
        }

        return urlSb.toString();
    }
174930
public URI location() {
		String loc = http().getHeaderField("Location");
		if (loc != null) {
			return URI.create(loc);
		}
		return null;
	}
859757
protected function _loginActionRedirectUrl()
    {
        $urlToRedirectBackTo = $this->_getUrlToRedirectBackTo();

        $loginAction = $this->_config['loginAction'];
        if ($urlToRedirectBackTo === '/') {
            return $loginAction;
        }

        if (is_array($loginAction)) {
            $loginAction['?'][static::QUERY_STRING_REDIRECT] = $urlToRedirectBackTo;
        } else {
            $char = strpos($loginAction, '?') === false ? '?' : '&';
            $loginAction .= $char . static::QUERY_STRING_REDIRECT . '=' . urlencode($urlToRedirectBackTo);
        }

        return $loginAction;
    }
883647
public String path() {
    /* build the fully qualified url with all query parameters */
    StringBuilder path = new StringBuilder();
    if (this.target != null) {
      path.append(this.target);
    }
    if (this.uriTemplate != null) {
      path.append(this.uriTemplate.toString());
    }
    if (path.length() == 0) {
      /* no path indicates the root uri */
      path.append("/");
    }
    return path.toString();

  }