Plugins You can find out about all the publicly available Grails plugins.

Trimmer Plugin

  • Tags: /
  • Latest: 0.1
  • Last Updated: 04 September 2012
  • Grails version: 1.3 > *
4 votes
compile ":trimmer:0.1"

 Documentation  Source  Issues


Trim all String input + convert an textinput that contains only blanks into null.


grails install-plugin trimmer


As of grails >= 2.3 and later this plugin is not needed any longer because the default behaviour has changed to exactly what this plugin was achieving.

Trimmer Plugin - Trim all inputs

Did you ever wish to easily avoid leading and trailing spaces from being persisted in your DB by bad inputs ?

Then this plugin is for you.

Basically I think this plugin is needed in any serious grails application out there :)


Simply install via BuildConfig.groovy or with

grails install-plugin trimmer

and you are good to go.

Please try using BuildConfig.groovy as the later is deprecated.

All inputs will be trimmed and inputs that consist of blanks only will be converted to null.


There is no way (yet) to disable this behavior for a given given input field. Good thing I can't think of a possible input were leading or trailing spaces would be of valuable information. If there are ideas of how to make this a configurable behavior (be able to turn trimming of for certain fields), I'm more then interested.


This plugin is based on GRAILS-6901 so the credits go to Göran Ehrsson.