From 7db7592bebfefdd4eed858101e9d4fc0d10eba81 Mon Sep 17 00:00:00 2001 From: Michael Yan Date: Thu, 13 Jul 2023 16:40:47 +0800 Subject: [PATCH] =?UTF-8?q?Grails=20Plugin=20GSP:=20Fixes=20StackOverflowE?= =?UTF-8?q?rror,=20because=20DefaultGroovyPageLocator=E2=80=98s=20precompi?= =?UTF-8?q?ledGspMap=20was=20not=20properly=20initialized?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * related commit c921b03b --- .../grails/plugins/web/GroovyPagesAutoConfiguration.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/GroovyPagesAutoConfiguration.java b/grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/GroovyPagesAutoConfiguration.java index d175a4411e..1bca023f12 100644 --- a/grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/GroovyPagesAutoConfiguration.java +++ b/grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/GroovyPagesAutoConfiguration.java @@ -129,10 +129,11 @@ public CachingGrailsConventionGroovyPageLocator groovyPageLocator(ObjectProvider defaultViews = resourceLoader.getResource("classpath:gsp/views.properties"); } if (defaultViews.exists()) { - PropertiesFactoryBean pfb = new PropertiesFactoryBean(); - pfb.setIgnoreResourceNotFound(true); - pfb.setLocation(defaultViews); try { + PropertiesFactoryBean pfb = new PropertiesFactoryBean(); + pfb.setIgnoreResourceNotFound(true); + pfb.setLocation(defaultViews); + pfb.afterPropertiesSet(); Map precompiledGspMap = new HashMap<>(); CollectionUtils.mergePropertiesIntoMap(pfb.getObject(), precompiledGspMap); groovyPageLocator.setPrecompiledGspMap(precompiledGspMap);