在页面创建时将值插入grails创建链接参数

Mor*_*ork 6 grails params

我有一个列表视图,对于每一行,我想要一个链接到另一个列表视图,显示相关结果.我最终设法构建的createlink行看起来像这样

<a href="${createLink(controller : 'RunResults', action:'ListSpecific', params:'[id:testExecQueueInstance.id]')}">my link</a>
Run Code Online (Sandbox Code Playgroud)

这会生成链接

http://localhost:3278/FARTFramework/runResults/listSpecific/testExecQueueInstance.id
Run Code Online (Sandbox Code Playgroud)

我知道testExecQueueInstance.id是22,我希望链接实际上看起来像这样

http://localhost:3278/FARTFramework/runResults/listSpecific/22
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

我的想法是,我有一个像这样的控制器,然后应该列出那些匹配该ID的项目...

def ListSpecific(int id){

    render(view: "list", model: [runResultsInstanceList: RunResults.findAllByTestExeQueueID(id, [sort:"testExecTime", order: "desc"]), runResultsInstanceTotal: RunResults.count()])
}
Run Code Online (Sandbox Code Playgroud)

use*_*574 18

你在params地图上使用了撇号.你应该试试这个.

<a href="${createLink(controller : 'RunResults', action:'ListSpecific', params: [id:testExecQueueInstance.id])}">my link</a>
Run Code Online (Sandbox Code Playgroud)

请享用.