grails - Domain object string field auto triming -


Grails 2.2.3 from Grails 2.3.5 (groovy 2.0.8-> 2.1.9) After updating from I strange Behavior domain object:

  class element {string name string title fixed constraints = {title} nullable: true}}  

during the construction string field automatically Empty and empty string space empty

  def e = new element (name: '', title: 'SGG GG') e.name == Insert zero on e.title == ' Sgg gg '/ code>  

This super feature in the changelog of Grails & amp; Can not get; Groove How can I disable it?

From:

Default behavior during data binding in Grails 2.3 Trim the string. Apart from that, there is another default behavior for converting empty strings (nothing in the string, not even spaces) during data binding. Those 2 things are in that order, so if you do not put the string in anything, but the spacing is to bind the default behavior to the enclosure because the string will be trimmed and since then it is empty, changing it to zero will be given. It is a sensible default to disable any of those behaviors to have different config properties.

  // grails-app / conf / config.groovy grails.databinding.convertEmptyStringsToNull = false grails.databinding.trimStrings = false  

I believe it is mentioned


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -