- [x] I have searched the [issues](https://github.com/apache/incubator-dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/incubator-dubbo/wiki/FAQ) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: latest

### Step to reproduce this issue

1. export a rest service DemoService with a url: rest://127.0.0.1:4444/test/
2. then we will get a real rest service with rest://127.0.0.1:4444/test/DemoService
3. but when we export a rest service DemoService with a url: rest://127.0.0.1:4444/test
4. then we will get a real rest service with rest://127.0.0.1:4444/DemoService

Those are the different results, in the second case the context path test is missing.
So users use explicit exporter and invoker to call rest services, they would feel puzzled.

We should fix it by modifying getContextPath method.

webappPath = webappPath.substring(1);
                if (!contextPath.startsWith(webappPath)) {
                    throw new RpcException("Since you are using server='servlet', " +
                            "make sure that the 'contextpath' property starts with the path of external webapp");
                }
                contextPath = contextPath.substring(webappPath.length());
                if (contextPath.startsWith("/")) {
                    contextPath = contextPath.substring(1);
                }
            }
        }
        final Class resourceDef = GetRestful.getRootResourceClass(implClass) != null ? implClass : type;
        server.deploy(resourceDef, impl, contextPath);
        final RestServer s = server;
        return new Runnable() {
            @Override
            public void run() {
                
                
                s.undeploy(resourceDef);
            }
        };
    }
    @Override
    protected <T> T doRefer(Class<T> serviceType, URL url) throws RpcException {
        if (connectionMonitor == null) {
            connectionMonitor = new ConnectionMonitor();
        }
        
        PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();