Changing Grails GSP variable markers
Is there a way to change the gsp variable markers ${somevar} to something like [% somevar %], i'm having a problem using jquery templates because they use ${somevar} also and the gsp tries to render th开发者_如何转开发ose as grails variables which crashes the app.
I had such problem too, with jQuery Tmpl + Grails. After some investigations I found a way to accomplish this, by using:
<%='${somevar}'%>
this <%= %>
just prints value as is. Notice ''
are used there, it's a string values.
So, you GSP will be looking like:
<div class="item_<%='${index}'%>"><%='${data}'%></div>
Rather than changing how I do things for Grails, I solved this by using the alternative jquery-template markup...
{{= somejQueryTemplateVar}}
精彩评论