开发者

How to use message properties in TagLib

开发者 https://www.devze.com 2023-01-25 15:08 出处:网络
As I try to use a message properties开发者_高级运维 in taglib of my grails application it is empty.

As I try to use a message properties开发者_高级运维 in taglib of my grails application it is empty.

<g:set var="pos" value="${message(code:"rating.positive.title")}" />
<foo:bar someNew="bla" positiveTitle="${pos}" bean="${item}" />

results in log of the attrs of taglib (def bar)

someNew=bla
positiveTitle=
bean=item

Any idea why this won't work as expected?


Check your Quotation marks " vs '.

I'd try:

<g:set var="pos" value="${message(code:'rating.positive.title')}" />

instead of:

<g:set var="pos" value="${message(code:"rating.positive.title")}" />
0

精彩评论

暂无评论...
验证码 换一张
取 消