public class WebUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
currentContextPath(javax.servlet.ServletRequest request) |
static String |
extractQueryParamsFromUrl(String url) |
static String |
extractRequestDomainURL(javax.servlet.http.HttpServletRequest httpRequest,
boolean withContext)
This will return full domain name including http scheme and optionally with contextroot depends on 'withContext' value eg:
http://www.domain.com/cxt/xyz withContext value as true will return http://www.domain.com/cxt/
http://www.domain.com/cxt/xyz withContext value as false will return http://www.domain.com |
static String |
extractRequestedDomainName(javax.servlet.http.HttpServletRequest httpRequest)
This will return only domain name from http request
eg: http://www.domain.com/cxt/xyz will return www.domain.com http://somehost:8090/cxt/xyz will return somehost |
static String |
extractRequestedDomainName(String requestURL)
This will return only domain name from given requestUrl
eg: http://www.domain.com/cxt/xyz will return www.domain.com http://somehost:8090/cxt/xyz will return somehost |
static String |
extractURLWithoutQueryParams(String url) |
public static String extractRequestedDomainName(javax.servlet.http.HttpServletRequest httpRequest)
public static String extractRequestedDomainName(String requestURL)
public static String extractRequestDomainURL(javax.servlet.http.HttpServletRequest httpRequest, boolean withContext)
public static String currentContextPath(javax.servlet.ServletRequest request)
Copyright © 2015–2017 eGovernments Foundation. All rights reserved.