code: public static String getRequestURLBaseWithoutProtocol(HttpServletRequest req)
  	{
  		return req.getServerName() +
  				(req.getServerPort() != 80 ? ":" + req.getServerPort() : "");
  	}
docs: Gets a clean base url without the path from the current request.
  
  @param req
  @return