grails g:链接传递参数
我有这样的事情:
<g:each in="${temp}">
<li>Date: ${it.dateParticipated}, <br>Role: ${it.role}, <br>Acceptence: ${it.accepted}, <br>
<g:link controller="conference" action="participated" id="${it.conference.id}">
Conference: </g:link>${it.conference},<br>
Role: ${it.role}, <br>Status: ${it.status}</li><br>
<br>
</g:each>
我想做的是,当我单击“会议”时,将加载具有“参与”方法的控制器“会议”,并传递参数“it.conference”。我如何在 g:link 标记中传递此参数?
我需要这个,因为当我单击“会议”一词时,其他页面会加载会议详细信息并传递 id。
I have something like this:
<g:each in="${temp}">
<li>Date: ${it.dateParticipated}, <br>Role: ${it.role}, <br>Acceptence: ${it.accepted}, <br>
<g:link controller="conference" action="participated" id="${it.conference.id}">
Conference: </g:link>${it.conference},<br>
Role: ${it.role}, <br>Status: ${it.status}</li><br>
<br>
</g:each>
What i want to do is, when i click on 'Conference', the controller 'conference' with the method 'participated' is loaded, and the params 'it.conference' is passed. How can i pass this params in the g:link tag ?
I need this because, when i click in the 'conference' word, other page is loaded with the conference details with the id passed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 params 属性传入参数映射:
有关更多示例,请参阅文档 。
Use the params attribute to pass in a map of parameters:
See the documentation for more examples.
您需要用 ${ } 包装整个参数,而不是包装要单独传递的每个变量。
You need to wrap your entire params with ${ }, instead of wrapping every variable that you want to pass separately.