I did not find any spring class equivalent to UriInfo. But we can take the same information from the httpservlet request. Suppose the url is: http: localhost: 8080 / services / test? One = 1 & two = 2, then,
hsr.getServletContext.getContextPath() gives "/services"
hsr.getRequestURI() gives "/services/test"
hsr.getRequestURL() gives complete url "http:localhost:8080/services/test"
hsr.getQueryString() gives "one=1&two=2"
hsr.getServletPath() gives "/test"
hsr.getParameterMap() gives all query strings in a Map as key value pair
You can set and use these values in a URIinfo object
source
share