Wednesday, March 9, 2016

Grails decoding default html encoding

I was trying to embed a URL with ampersands '&' in my HTML page using the following expression:

GSP file

and since my default codec in Config.groovy was set to 'html':

grails.views.default.codec = "html"

The ampersand was always being converted to


What I wanted was just the '&' character in unencoded format.

To do that we can use the raw() function as follows:

GSP file


No comments:

Post a Comment