public static String getRequestServer(HttpServletRequest req) {
    return req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort();
  }
public static String getRequestServer(HttpServletRequest req) {
    return req.getScheme() + ":
  }
public static String getRequestServer ( HttpServletRequest req ) { return req . getScheme ( ) + "://" + req . getServerName ( ) + ":" + req . getServerPort ( ) ; }
This is the server part, eg http://motherlode:8080

@param req the HttpServletRequest
@return request server
This is the server part eg http : // motherlode : 8080