Skip to content

Commit 82465cf

Browse files
Mandapwilkinsona
Mandap
authored andcommitted
Fix JSP availability check when not running as a packaged war
See gh-12859
1 parent b35e1ad commit 82465cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/JspTemplateAvailabilityProvider.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public boolean isTemplateAvailable(String view, Environment environment,
3838
ClassLoader classLoader, ResourceLoader resourceLoader) {
3939
if (ClassUtils.isPresent("org.apache.jasper.compiler.JspConfig", classLoader)) {
4040
String resourceName = getResourceName(view, environment);
41-
return resourceLoader.getResource(resourceName).exists();
41+
return resourceLoader.getResource(resourceName).exists() ||
42+
resourceLoader.getResource("file:./src/main/webapp" + resourceName).exists();
4243
}
4344
return false;
4445
}

0 commit comments

Comments
 (0)