单击g:actionSubmit按钮时如何继承参数?

这是我的gsp代码:

<g:checkBox name="msgCheck" checked="" value="${userInstance.emailId}"></g:checkBox>
...
<g:actionSubmit class="update" action="delete" value="Delete" params="${params}"></g:actionSubmit>

这是我的 Controller 代码:
def delete() {
    try {
        def user_list = params.msgCheck

        //deleting the user
        //successful.

        redirect(action: "list", params: params)
    } catch (Exception e) {
        log.error("Deleted Exception---->>" + e.getMessage())
    }
}
params缺少重定向。我想在params上继承redirect

在单击“删除” g:actionSubmit按钮之前的URL看起来像:
http://localhost:8080/message/list?offset=10&max=100

单击“删除” g:actionSubmit按钮后,该URL看起来像(并具有其他参数:
 http://localhost:8080/message/list?msgCheck=ga12%40user.com&msgCheck=&_action_domainDelete=Delete&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&domainId=1&noofrows=100

单击g:actionSubmit按钮时如何继承参数?

最佳答案

我认为您无法以这种方式传递paramsactionSubmit。您可以使用g:form tagparams属性,例如

<g:form params="${params}">
    ...
</g:form>

要么
<g:form params="[offset: params.offset, max: params.max]">
    ...
</g:form>

09-27 09:30