diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/resource/PathResourceResolver.java b/spring-webflux/src/main/java/org/springframework/web/reactive/resource/PathResourceResolver.java index dbc86614364b..4b61143b8033 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/resource/PathResourceResolver.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/resource/PathResourceResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -123,8 +123,8 @@ else if (logger.isWarnEnabled()) { Resource[] allowed = getAllowedLocations(); logger.warn(LogFormatUtils.formatValue( "Resource path \"" + resourcePath + "\" was successfully resolved " + - "but resource \"" + resource.getURL() + "\" is neither under the " + - "current location \"" + location.getURL() + "\" nor under any of the " + + "but resource \"" + resource + "\" is neither under the " + + "current location \"" + location + "\" nor under any of the " + "allowed locations " + (allowed != null ? Arrays.asList(allowed) : "[]"), -1, true)); } } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java index 6704b98d503a..3902a6ae7a6f 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/PathResourceResolver.java @@ -195,8 +195,8 @@ else if (logger.isWarnEnabled()) { Resource[] allowed = getAllowedLocations(); logger.warn(LogFormatUtils.formatValue( "Resource path \"" + resourcePath + "\" was successfully resolved " + - "but resource \"" + resource.getURL() + "\" is neither under " + - "the current location \"" + location.getURL() + "\" nor under any of " + + "but resource \"" + resource + "\" is neither under " + + "the current location \"" + location + "\" nor under any of " + "the allowed locations " + (allowed != null ? Arrays.asList(allowed) : "[]"), -1, true)); } }