diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java index 8516d0125c..e49cc2b66a 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHttpRequestHandler.java @@ -316,7 +316,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator implements H locationPath = location.getURL().getPath(); } locationPath = (locationPath.endsWith("/") || - !StringUtils.hasText(locationPath) ? locationPath : locationPath + "/"); + !StringUtils.hasLength(locationPath) ? locationPath : locationPath + "/"); if (!resourcePath.startsWith(locationPath)) { return false; }