public static String extractBaseURL( final HttpServletRequest request,
                                         final ConfigReader config ) {
        if (config.getBaseURL() != null) {
            return config.getBaseURL();
        } else if ((request.getServerPort() == 80)
                || (request.getServerPort() == 443)) {
            return request.getScheme() + "://"
                    + request.getServerName();
        } else {
            return request.getScheme() + "://"
                    + request.getServerName() + ":" + request.getServerPort();
        }
    }
public static String extractBaseURL ( final HttpServletRequest request , final ConfigReader config ) { if ( config . getBaseURL ( ) != null ) { return config . getBaseURL ( ) ; } else if ( ( request . getServerPort ( ) == 80 ) || ( request . getServerPort ( ) == 443 ) ) { return request . getScheme ( ) + "://" + request . getServerName ( ) ; } else { return request . getScheme ( ) + "://" + request . getServerName ( ) + ":" + request . getServerPort ( ) ; } }
@param request
@param config
@return