繁体   English   中英

在GSP中嵌套grails函数调用的语法($ {remoteFunction}中的动态值作为<g:remoteLink>

[英]Syntax for nesting grails function calls in GSP (dynamic values in ${remoteFunction} as parameter to <g:remoteLink>

我在找出正确的方法来引用以下调用以使其正确呈现时遇到麻烦。 因为'remoteFunction'是作为after =“”的参数调用的,所以我不能在其中使用双引号,因此$ {pictureInThread.id}是按字面呈现而不是被调用。 如果我将单引号更改为双引号,则它会因为终止after =“早而中断。

注意为了便于阅读,在下面的示例中,我已将其他参数删除到remoteLink中。

<g:remoteLink after="${remoteFunction(controller:'voting',action:'computeScore',update:'${pictureInThread.id}')}">

你有没有尝试过:

<g:remoteLink after="${remoteFunction(controller:'voting',action:'computeScore',update:pictureInThread.id)}">

由于您已经在Groovy脚本块中,因此您应该能够直接引用该变量。

暂无
暂无

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

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