1
如何在超链接点击时继承参数?Grails:对超链接进行params点击
这里是我的gsp
代码:
<g:link class="grid_link" controller="user" action="delete" id="${userInstance.id}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure, want to delete?')}');">Delete</g:link>
这里是我的控制器代码:
def delete() {
try {
def userInstance = User.get(params.id)
//deleting the user
//successful.
redirect(action: "list", params: params)
} catch (Exception e) {
log.error("Deleted Exception---->>" + e.getMessage())
}
}
重定向与params
失踪。我想在redirect
上发扬params
。
之前,我点击“删除”超链接的URL看起来像:
http://localhost:8080/message/list?offset=10&max=100
“删除”超级链接被点击后,链接的样子:
http://localhost:8080/message/list/11
如何发扬超链接被点击时的参数?