Overriding grails.views.default.codec=’html’ config back to ‘none’

To summarize the various levels at which the codec can be applied: Set Config.groovy’s grails.views.default.codec=”html” to get HTML escaping by default on all ${expressions} in the application. Then when you want to default a whole page back to none, use the directive: <%@page defaultCodec=”none” %> or <%@ defaultCodec=”none” %> To disable HTML encoding for one … Read more

How to access Grails configuration in Grails 2.0?

If you need it in an artifact that supports dependency injection, simply inject grailsApplication class MyController { def grailsApplication def myAction = { def bar = grailsApplication.config.my.property } } If you need it in a bean in, say, src/groovy or src/java, wire it up using conf/spring/resources.groovy // src/groovy/com/example/MyBean.groovy class MyBean { def grailsApplication def foo() … Read more

Grails3 file upload maxFileSize limit

Grails 3, Grails 4, Grails 5 and Grails 6 The solution is to set maxFileSize and maxRequestSize limits inside your application.yml file (usually placed inside grails-app/conf/). Be sure to have something like this: grails: controllers: upload: maxFileSize: 2000000 maxRequestSize: 2000000 Replace 2000000 with the number of max bytes you want for a file upload and … Read more

Grails unable to install plugin

The repository changed and it’s causing problem for older Grails versions. See my answer at: Grails Url shortener plugin not getting installed : Please use mavenRepo “https://repo.grails.org/grails/plugins” As a repository definition. http://grails.1312388.n4.nabble.com/Grails-central-repo-seemingly-missing-plugin-versions-td4658720.html