mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-15 01:07:30 +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,7 +43,11 @@ public class JspTemplateAvailabilityProvider implements TemplateAvailabilityProv
|
||||
if (resourceLoader.getResource(resourceName).exists()) {
|
||||
return true;
|
||||
}
|
||||
return new File("src/main/webapp", resourceName).exists();
|
||||
try {
|
||||
return new File("src/main/webapp", resourceName).exists();
|
||||
}
|
||||
catch (AccessControlException ex) {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user