In Grails, how can I get the request URI, including request parameters?

If my incoming url ...

http://data-api:8080/policies/400?output=json 

... which method on the request object in Grails will give me this ...

 /policies/400?output=json 

I know request.forwardURI gives everything before?, But does not include parameters

+4
source share
3 answers
 request.requestURI + '?' + request.queryString 
+14
source

I found the difference request.requestURI between Jetty and WebLogic 10.2.

So, I am using a helper class:

 def helper = new org.springframework.web.util.UrlPathHelper() def reqURI = helper.getOriginatingRequestUri(request) def qryStr = helper.getOriginatingQueryString(request) 
+2
source

this may not be the best solution, but I am using the following:

 request.forwardURI+'?'+request.'javax.servlet.forward.query_string' 
+1
source

Source: https://habr.com/ru/post/1387585/


All Articles