Polish "Handle AccessControlException in JspTemplateAvailabilityProvider"

Closes gh-15778
pull/15889/head
Stephane Nicoll 6 years ago
parent 81273bdf9a
commit c5675de666

@ -31,7 +31,6 @@ import org.springframework.util.ClassUtils;
* @author Andy Wilkinson
* @author Stephane Nicoll
* @author Madhura Bhave
* @author Artsiom Yudovin
* @since 1.1.0
*/
public class JspTemplateAvailabilityProvider implements TemplateAvailabilityProvider {
@ -40,12 +39,10 @@ public class JspTemplateAvailabilityProvider implements TemplateAvailabilityProv
public boolean isTemplateAvailable(String view, Environment environment,
ClassLoader classLoader, ResourceLoader resourceLoader) {
if (ClassUtils.isPresent("org.apache.jasper.compiler.JspConfig", classLoader)) {
String resourceName = getResourceName(view, environment);
if (resourceLoader.getResource(resourceName).exists()) {
return true;
}
try {
return new File("src/main/webapp", resourceName).exists();
}

Loading…
Cancel
Save