2.7.0版本getContextPath方法：
```
protected String getContextPath(URL url) {
        String contextPath = url.getPath();
        return contextPath.endsWith("/") ? contextPath.substring(0,contextPath.length()-1) : contextPath;
    }
```
无法将方法置入web容器中，退回2.6.5版本的方法：
```
protected String getContextPath(URL url) {
        int pos = url.getPath().lastIndexOf("/");
        return pos > 0 ? url.getPath().substring(0, pos) : "";
    }
```
使用正常，两个方法应该不等价的。
if (i >= 0 && i < url.length() - 1) {
            if (url.lastIndexOf("%") > i) {
                
                
                
                
            } else {
                port = Integer.parseInt(url.substring(i + 1));
                url = url.substring(0, i);
            }
        }
        if (url.length() > 0) {
            host = url;
        }
        return new URL(protocol, username, password, host, port, path, parameters);
    }
    public static URL valueOf(String url, String... reserveParams) {
        URL result = valueOf(url);
        if (reserveParams == null || reserveParams.length == 0) {
            return result;
        }
        Map<String, String> newMap = new HashMap<>(reserveParams.length);
        Map<String, String> oldMap = result.getParameters();
        for (String reserveParam : reserveParams) {
            String tmp = oldMap.get(reserveParam);
            if (StringUtils.isNotEmpty(tmp)) {
                newMap.put(reserveParam, tmp);
            }
        }
        return result.clearParameters().addParameters(newMap);