code: private String stripContextPath(final String contextPath, String uri)
     {
        if (!contextPath.equals("/") && uri.startsWith(contextPath))
        {
           uri = uri.substring(contextPath.length());
        }
        return uri;
     }
docs: If the given URL is prefixed with this request's context-path, return the URI without the context path. Otherwise
  return the URI unchanged.