From 4bcf92f176d067f547b9115f448af6cbfe52d0c8 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 30 Dec 2014 15:31:13 +0100 Subject: [PATCH] Restore JDK 5 compatiblity --- .../web/servlet/resource/ResourceHttpRequestHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 cf358c0467..8516d0125c 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 @@ -315,7 +315,8 @@ public class ResourceHttpRequestHandler extends WebContentGenerator implements H resourcePath = resource.getURL().getPath(); locationPath = location.getURL().getPath(); } - locationPath = (locationPath.endsWith("/") || locationPath.isEmpty() ? locationPath : locationPath + "/"); + locationPath = (locationPath.endsWith("/") || + !StringUtils.hasText(locationPath) ? locationPath : locationPath + "/"); if (!resourcePath.startsWith(locationPath)) { return false; }