Skip to content

Commit

Permalink
Grails Plugin GSP: Fixes circle reference error in GroovyPagesAutoCon…
Browse files Browse the repository at this point in the history
…figuration

* groovyPageLayoutFinder dependent jspViewResolver
  • Loading branch information
rainboyan committed Jun 28, 2023
1 parent d1c8806 commit 390aee0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.springframework.util.ClassUtils;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.ViewResolver;

import grails.config.Config;
import grails.config.Settings;
Expand Down Expand Up @@ -290,7 +289,8 @@ public PageRenderer groovyPageRenderer(CachingGrailsConventionGroovyPageLocator

@Bean
@ConditionalOnMissingBean
public GroovyPageLayoutFinder groovyPageLayoutFinder(ObjectProvider<GrailsApplication> grailsApplication, ObjectProvider<ViewResolver> viewResolver) {
public GroovyPageLayoutFinder groovyPageLayoutFinder(ObjectProvider<GrailsApplication> grailsApplication,
ObjectProvider<GroovyPageViewResolver> jspViewResolver) {
Config config = grailsApplication.getIfAvailable().getConfig();
Environment env = Environment.getCurrent();
boolean developmentMode = Environment.isDevelopmentEnvironmentAvailable();
Expand All @@ -303,7 +303,7 @@ public GroovyPageLayoutFinder groovyPageLayoutFinder(ObjectProvider<GrailsApplic
groovyPageLayoutFinder.setGspReloadEnabled(enableReload);
groovyPageLayoutFinder.setDefaultDecoratorName(defaultDecoratorName);
groovyPageLayoutFinder.setEnableNonGspViews(sitemeshEnableNonGspViews);
viewResolver.ifAvailable(groovyPageLayoutFinder::setViewResolver);
jspViewResolver.ifAvailable(groovyPageLayoutFinder::setViewResolver);

return groovyPageLayoutFinder;
}
Expand Down

0 comments on commit 390aee0

Please sign in to comment.