Skip to content

Instantly share code, notes, and snippets.

@mathifonseca
Last active August 29, 2015 14:01
Show Gist options
  • Save mathifonseca/02459a5a5ab2d5988f9c to your computer and use it in GitHub Desktop.
Save mathifonseca/02459a5a5ab2d5988f9c to your computer and use it in GitHub Desktop.
GRAILS - Strange behaviour when having a whitespace in a GSP tag

In Grails 2.3.7, if you accidentally (I can't think of any other reason) leave a white space between the closing bracket and quote of the test attribute of an <g:if> tag, its condition will always evaluate to false.

<g:if test="${1 != 2} ">
     Should be here...
</g:if>
<g:else>
     But it’s here!
</g:else>

Anyway, it seems to be corrected in Grails 2.4.0, but maybe this helps anyone out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment