public static String getRootRelativePath(String url) {

		Matcher matcher = URL_SEPARATOR_PATTERN.matcher(url);
		StringBuffer result = new StringBuffer();
		boolean first = true;
		while (matcher.find()) {
			if (first) {
				matcher.appendReplacement(result, "");
				first = false;
			} else {
				matcher.appendReplacement(result, ROOT_REPLACE_PATTERN);
			}
		}

		return result.toString();
	}
public static String getRootRelativePath ( String url ) { Matcher matcher = URL_SEPARATOR_PATTERN . matcher ( url ) ; StringBuffer result = new StringBuffer ( ) ; boolean first = true ; while ( matcher . find ( ) ) { if ( first ) { matcher . appendReplacement ( result , "" ) ; first = false ; } else { matcher . appendReplacement ( result , ROOT_REPLACE_PATTERN ) ; } } return result . toString ( ) ; }
Returns the relative path of an url to go back to the root. For example :
if the url path is defined as "/cssServletPath/css/myStyle.css" ->
"../../"

@param url
the requested url
@return the relative path of an url to go back to the root.