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) |
static <T> String |
toJSON(Collection<T> objects,
Class<? extends T> objectClazz,
Class<? extends com.google.gson.JsonSerializer<T>> adptorClazz) |
static <T> String |
toJSON(T object,
Class<? extends com.google.gson.JsonSerializer<T>> adptorClazz) |
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)
public static <T> String toJSON(Collection<T> objects, Class<? extends T> objectClazz, Class<? extends com.google.gson.JsonSerializer<T>> adptorClazz)
Copyright © 2015–2016 eGovernments Foundation. All rights reserved.