在Grails应用中隐藏URL中的id参数 [英] Hide id param in url in Grails App

查看:125
本文介绍了在Grails应用中隐藏URL中的id参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类似 / myController / myAction / id 的网址。



我该如何隐藏该URL中的id,使其如下所示: / myController / myAction / username [email]

解决方案定义在UrlMapping.groovy中作为/ myController / myAction / $ username(controller:myController,action: myAction),你可以在控制器 params.username

中获得参数

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]

解决方案

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

这篇关于在Grails应用中隐藏URL中的id参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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