Skip to content

Commit 3127487

Browse files
GRAILS-6221 - change WebUtils.lookupResolver(ServletContext) to return the jspViewResolver bean instead of the first ViewResolver bean found in the application context.
1 parent ac8191a commit 3127487

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/java/org/codehaus/groovy/grails/web/util/WebUtils.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,7 @@ public class WebUtils extends org.springframework.web.util.WebUtils {
7474

7575
public static ViewResolver lookupViewResolver(ServletContext servletContext) {
7676
WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
77-
78-
String[] beanNames = wac.getBeanNamesForType(ViewResolver.class);
79-
if (beanNames.length > 0) {
80-
String beanName = beanNames[0];
81-
return (ViewResolver)wac.getBean(beanName);
82-
}
83-
return null;
77+
return (ViewResolver)wac.getBean("jspViewResolver");
8478
}
8579

8680
/**

0 commit comments

Comments
 (0)