Permalink
Browse files

GRAILS-9569 if config attribute grails.web.linkGenerator.useCache is …

…false, a DefaultLinkGenerator is used instead of a CachingLinkGenerator
  • Loading branch information...
1 parent f56a52d commit e0f436d09748082872dc6dddd9426dcd652b1e58 Burt Beckwith committed Nov 9, 2012
@@ -23,6 +23,7 @@ import org.codehaus.groovy.grails.commons.GrailsApplication
import org.codehaus.groovy.grails.commons.UrlMappingsArtefactHandler
import org.codehaus.groovy.grails.plugins.GrailsPluginManager
import org.codehaus.groovy.grails.web.mapping.CachingLinkGenerator
+import org.codehaus.groovy.grails.web.mapping.DefaultLinkGenerator
import org.codehaus.groovy.grails.web.mapping.LinkGenerator
import org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder
import org.codehaus.groovy.grails.web.mapping.UrlMappingsHolderFactoryBean
@@ -57,7 +58,11 @@ class UrlMappingsGrailsPlugin {
def urlConverterType = application.config?.grails?.web?.url?.converter
"${grails.web.UrlConverter.BEAN_NAME}"('hyphenated' == urlConverterType ? HyphenatedUrlConverter : CamelCaseUrlConverter)
- grailsLinkGenerator(CachingLinkGenerator, serverURL)
+ def cacheUrls = application.config?.grails?.web?.linkGenerator?.useCache
+ if (!(cacheUrls instanceof Boolean)) {
+ cacheUrls = true
+ }
+ grailsLinkGenerator(cacheUrls ? CachingLinkGenerator : DefaultLinkGenerator, serverURL)
"org.grails.internal.URL_MAPPINGS_HOLDER"(UrlMappingsHolderFactoryBean) { bean ->
bean.lazyInit = true

0 comments on commit e0f436d

Please sign in to comment.