mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge pull request #15778 from ayudovin
* pr/15778: Polish "Handle AccessControlException in JspTemplateAvailabilityProvider" Handle AccessControlException in JspTemplateAvailabilityProvider
This commit is contained in:
commit
9d609ab1ba
@ -17,6 +17,7 @@
|
||||
package org.springframework.boot.autoconfigure.web.servlet;
|
||||
|
||||
import java.io.File;
|
||||
import java.security.AccessControlException;
|
||||
|
||||
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider;
|
||||
import org.springframework.core.env.Environment;
|
||||
@ -42,8 +43,12 @@ public class JspTemplateAvailabilityProvider implements TemplateAvailabilityProv
|
||||
if (resourceLoader.getResource(resourceName).exists()) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
return new File("src/main/webapp", resourceName).exists();
|
||||
}
|
||||
catch (AccessControlException ex) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user