The Method request.getRequestURI() returns URI with context path.
For example, if the base URL of an application is http://localhost:8080/myapp/ (i.e.
http://localhost:8080/myapp/
May be you can just use the split method to eliminate the '/myapp' for example:
string[] uris=request.getRequestURI().split("/"); string uri="/"+uri[1]+"/"+uris[2];