diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java b/java/org/apache/catalina/servlets/DefaultServlet.java index 02eb1ffc9d3d..1043f31bc8c1 100644 --- a/java/org/apache/catalina/servlets/DefaultServlet.java +++ b/java/org/apache/catalina/servlets/DefaultServlet.java @@ -350,11 +350,11 @@ protected String getRelativePath(HttpServletRequest request) { } StringBuilder result = new StringBuilder(); - if (servletPath != null) { + if (servletPath.length() > 0) { result.append(servletPath); - if (pathInfo != null) { - result.append(pathInfo); - } + } + if (pathInfo != null) { + result.append(pathInfo); } if (result.length() == 0) { result.append('/');