Groovy GSP <g: if>

It made me crazy for hours and probably very obvious to someone ...

Can anyone understand why this prints out even if his message is false?

<g:if test="${className == 'SRep'}">
    ${className == 'SRep'}
</g:if> 

If classname == SRep, then this is correct. However, if classname <> SRep still displays false? I do not understand how this can be.

If i use? showSource = true, the if statement looks like this:

if(true && ("false")) {
  printHtmlPart(29)
}
else {
  printHtmlPart(30)
}

Does anyone see something obvious?

Thanks, John

+3
source share
1 answer

your code looks great, but I'm not sure what “className” is, maybe it doesn’t return or doesn’t return the wrong type, etc.:

i GSP Name, , GSP:

${className} //displays the value

, , , :

${className?.class} //displays the type of object
+1

Source: https://habr.com/ru/post/1782029/


All Articles