From the following URL I need to get (http://localhost:9090/dts) alone. That is I need to remove (documents/savedoc) (OR) need to get on
(http://localhost:9090/dts)
(documents/savedoc)
AFAIK for this there is no API provided method, need to customization.
String serverName = request.getServerName(); int portNumber = request.getServerPort(); String contextPath = request.getContextPath();
// try this
System.out.println(serverName + ":" +portNumber + contextPath );