code: public static String getDomain(HttpServletRequest request) {
  
  		if (request == null) {
  			return null;
  		}
  
  		return UrlUtils.resolveDomain(request.getServerName());
  	}
docs: Resolves domain name from given URL
  
  @param request to get domain name from
  @return domain name or null if not resolved