private String computeCssUriForExternalServer(final String cssUri) {
    String exernalServerCssUri = cssUri;
    try {
      // compute the host of the external server (with protocol & port).
      final String serverHost = cssUri.replace(new URL(cssUri).getPath(), StringUtils.EMPTY);
      // the uri should end mandatory with /
      exernalServerCssUri = serverHost + ServletContextUriLocator.PREFIX;
      LOG.debug("using {} host as cssUri", exernalServerCssUri);
    } catch (final MalformedURLException e) {
      // should never happen
    }
    return exernalServerCssUri;
  }
private String computeCssUriForExternalServer(final String cssUri) {
    String exernalServerCssUri = cssUri;
    try {
      
      final String serverHost = cssUri.replace(new URL(cssUri).getPath(), StringUtils.EMPTY);
      
      exernalServerCssUri = serverHost + ServletContextUriLocator.PREFIX;
      LOG.debug("using {} host as cssUri", exernalServerCssUri);
    } catch (final MalformedURLException e) {
      
    }
    return exernalServerCssUri;
  }
private String computeCssUriForExternalServer ( final String cssUri ) { String exernalServerCssUri = cssUri ; try { // compute the host of the external server (with protocol & port). final String serverHost = cssUri . replace ( new URL ( cssUri ) . getPath ( ) , StringUtils . EMPTY ) ; // the uri should end mandatory with / exernalServerCssUri = serverHost + ServletContextUriLocator . PREFIX ; LOG . debug ( "using {} host as cssUri" , exernalServerCssUri ) ; } catch ( final MalformedURLException e ) { // should never happen } return exernalServerCssUri ; }
Css files hosted on external server, should use its host as the root context when rewriting image url's starting
with '/' character.
Css files hosted on external server should use its host as the root context when rewriting image url s starting with / character .