简体   繁体   English

如何将 gsp 中地图列表中的值传递给操作?

[英]how to pass value from list of maps in gsp to action?

<g:each  in="${flist}"> <tr bgcolor="#ffffff">
            <td align="center"><g:link controller="spider" action="ThirdPage" params="${it.get('dt')}">
            ${it.get('dt')}</g:link>
            </td></tr>

wher flist is list of maps.now i want to pass dt which is key in map within list to controller action.i tried it with above codes but its not working.what mistake i am doing there. flist 是地图列表。现在我想将列表中 map 中的关键 dt 传递给 controller 操作。我用上面的代码尝试过,但它不起作用。我在那里犯了什么错误。

Thanks in advance, laxmi在此先感谢,拉克斯米

Your params should be a map.您的参数应该是 map。 Looks like you are passing a value in params.看起来您正在参数中传递一个值。 you need to send a map in params.您需要在参数中发送 map。

are you sure that flist is of type List<Map> ?你确定 flist 的类型是List<Map>吗? have you tried to print out the flist params?您是否尝试打印出 flist 参数? are you sure that you have closed the each tag?你确定你已经关闭了每个标签吗?

<g:link controller="spider" action="ThirdPage" params="[paramName: it.get('dt')]">${it.get('dt')}</g:link>

be careful that you pass the link params in the right way.请注意以正确的方式传递链接参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM