Grails “loses” custom URL mapping when following any links on the page

微笑、不失礼 提交于 2019-12-04 19:08:10

It seems that the problem is not at your URL mapping configuration ,but in your way to create link. I think it's better if you use Named URL Mapping : it's clearer than your approach now, and when create link for pagination you only need to specify the url name. For example:

In UrlMappings.groovy:

static mappings = {

    name accountDetails: "/details/$acctNumber" {
        controller = 'product'
        action = 'accountDetails'
    }
}

In view - gsp page:

<g:link mapping="accountDetails" params="[acctNumber:'8675309']">
    Show Account
</g:link>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!