public static final String getRelativeURI ( String contextPath , String uri ) { String requestUrl = uri ; int overlap = requestUrl . indexOf ( contextPath + ' ' ) ; assert overlap != - 1 : "contextPath: " + contextPath + ", uri: " + uri ; return requestUrl . substring ( overlap + contextPath . length ( ) ) ; }
Get a URI relative to a given webapp root .