3

While I understand that it is not "best practice", I have a lot of legacy plugins that I am upgrading to Grails 3, and I need to set their GSP encoding back to the old default of "none" (because everything is already encoded where it needs to be, and we expect non-encoded data elsewhere.) Unfortunately, this appears to not work per the documentation.

The Grails 3.2.11 docs say:

Per Plugin Encoding

Grails also features the ability to control the codecs used on a per plugin basis. For example if you have a plugin named foo installed, then placing the following configuration in your application.groovy will disable encoding for only the foo plugin

foo.grails.views.gsp.codecs.expression = "none"

This did not work, using Grails 3.2.11. Encoding is still "html".

Other things I tried, that also did not work:

  • Just changing the plugin's application.yml from the default values (this seems like it would be ideal to me, and was what I originally expected would control the plugin encoding)
  • Same line, in runtime.groovy
  • Same line, in the plugin's plugin.groovy
  • Same concept with the prefix, in both the application's and the plugin's application.yml
  • Changes per suggestions in How can I exclude a plugin from grails default gsp encoding?

I'm perfectly willing to write this up as a Grails bug, but figured I would ask here first in case somebody else has already solved this!

Thanks in advance!

Community
  • 1
  • 1
Daniel
  • 3,312
  • 1
  • 14
  • 31

1 Answers1

1

See linked grails issue for answer; short version is that:

  • all codecs must be valid, or defaults are used due to exception thrown in codec processing
  • plugins should be cleaned before publishing, or precompiled gsps may still use previous codecs
Daniel
  • 3,312
  • 1
  • 14
  • 31