我的 grails 控制器由以下 URL 调用
/center/madrid/12-de-octubre
/center/madrid/12-de-octubre?opt=1
Run Code Online (Sandbox Code Playgroud)
如果 ? 之后有任何参数,我需要控制器表现不同。在网址中
我有以下 URL 映射:
name center: "/center/$_uni_city/$_uni_facility_name" {
controller = "site"
action = "centerprofile"
}
Run Code Online (Sandbox Code Playgroud)
虽然我可以找到所有参数(例如 _uni_city=Madrid、opt=1),但在应用 URLMappings(即上面示例中的 opt)后,我无法确定哪些参数来自查询字符串。
有没有办法在 grails 控制器中检索原始请求 URL(即/center/madrid/12-de-octubere?opt=1)?