提交 2c7d2f70 编写于 作者: J Juergen Hoeller 提交者: Chris Beams

Handle non-existent files in ServletContextResource

ServletContextResource#getFile now falls back to #getRealPath for
non-existent files

Issue: SPR-8461
上级 c8e693b8
......@@ -166,8 +166,8 @@ public class ServletContextResource extends AbstractFileResolvingResource implem
*/
@Override
public File getFile() throws IOException {
URL url = getURL();
if (ResourceUtils.isFileURL(url)) {
URL url = this.servletContext.getResource(this.path);
if (url != null && ResourceUtils.isFileURL(url)) {
// Proceed with file system resolution...
return super.getFile();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册