在Grails中,我如何获取包含请求参数的请求URI? [英] In Grails, how can I get the request URI including request parameters?

查看:74
本文介绍了在Grails中,我如何获取包含请求参数的请求URI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

...在Grails的请求对象上有什么方法会给我这个.. 。

  / policies / 400?output = json 

我知道 request.forwardURI 提供了一切,但不包含参数

解决方案

  request.requestURI +'?'+ request.queryString 
pre>

If my incoming URL is this....

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

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

/policies/400?output=json

I know request.forwardURI gives everything up to ?, but does not include the parameters

解决方案

request.requestURI + '?' + request.queryString 

这篇关于在Grails中,我如何获取包含请求参数的请求URI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆