【发布时间】:2015-06-14 08:46:45
【问题描述】:
点击超链接时如何将参数前移?
这是我的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
点击超链接时如何将参数结转?
【问题讨论】:
标签: grails redirect controller