1

Updated Grails from 2.2.0 to 2.2.4.
Before: http://localhost:8180/sub:favorites
After: http://localhost:8180/sub%3Afavorites

As you can see Grails encodes URL's params by default. How can I disable it and encode it manually?

fedor.belov
  • 22,343
  • 26
  • 89
  • 134
  • I believe you are willing to change encoding settings (http://stackoverflow.com/questions/1337464/overriding-grails-views-default-codec-html-config-back-to-none – Ivar Sep 10 '13 at 15:03
  • I'm experiencing exactly the same problem after update from 2.2.0 to 2.2.5. My solution (for now) will be decode the URL manually as @fedor-belov said below. – cantoni Jun 09 '14 at 17:38

1 Answers1

3

Chances are high that there is an easier way. But if there isn't you can do the following:

Grails registeres a bean named grailsLinkGenerator. This bean is used for creating links (createLink(..) or <g:createLink />) within the the application. I think the default implementation is a CachingLinkGenerator which is a subclass of DefaultLinkGenerator which again implements the interface LinkGenerator.

You could extend one of these classes and override the bean in resources.groovy:

 grailsLinkGenerator(YourLinkGenerator) {
   ..
 }
micha
  • 47,774
  • 16
  • 73
  • 80
  • 1
    This behaviour is hard coded in `RegexUrlMapping` class, method `encode` since 2.2.2. I've created ticket to change it - http://jira.grails.org/browse/GRAILS-10477 . For now the only way to solve this problem is to manually decode URL – fedor.belov Sep 13 '13 at 13:11