public static String filterTarget(String rawPathInfo, String rawServletPath) {
        String pathInfo = getResourcePath(rawPathInfo, rawServletPath);
        if (!pathInfo.startsWith(PATH_SPLIT)) {
            pathInfo = PATH_SPLIT + pathInfo;
        }

        if (PATH_SPLIT.equals(pathInfo)) {
            return pathInfo;
        }

        // Note: pathInfo should be converted to camelCase style.
        int lastSlashIndex = pathInfo.lastIndexOf(PATH_SPLIT);

        if (lastSlashIndex >= 0) {
            pathInfo = pathInfo.substring(0, lastSlashIndex) + PATH_SPLIT
                    + StringUtils.trim(pathInfo.substring(lastSlashIndex + 1));
        } else {
            pathInfo = PATH_SPLIT + StringUtils.trim(pathInfo);
        }

        return pathInfo;
    }
@Test
    public void test() {
        String context = "/context";
        String path = "/api";
        final String url = FilterUtil.filterTarget("\\/api", "\\/context");
        Assert.assertEquals(url, context + path);
    }