问题
I have a URL that looks like /myController/myAction/id.
How could I hide the id in that URL so it looks like: /myController/myAction/username [email]
回答1:
Define in UrlMapping.groovy as "/myController/myAction/$username"(controller: "myController",action: "myAction")
and you'll be able to get the param in controller params.username
回答2:
Define in UrlMapping.groovy
as "/myController/myAction/$username"(controller: "myController",action: "myAction")
you'll be able to get the param in controller params.username
来源:https://stackoverflow.com/questions/16838160/hide-id-param-in-url-in-grails-app