How do I branch if message.properties-code exists

Posted by skurt on Stack Overflow See other posts from Stack Overflow or by skurt
Published on 2010-06-02T13:19:56Z Indexed on 2010/06/02 13:34 UTC
Read the original article Hit count: 160

Filed under:
|
|

I want to branch if a message-property-code does exist or not.

<g:if test="${message(code: 'default.code.foo')}">
  true
</g:if><g:else>
 false
</g:else>

should answer true if there a message property named default.code.foo and false if not.

It fails because it answers the code if there is no property for it.

© Stack Overflow or respective owner

Related posts about grails

Related posts about groovy