UrlPathHelper cuts off trailing servlet-path slashes for root mappings (on WebSphere; SPR-7052)
This commit is contained in:
@@ -18,7 +18,6 @@ package org.springframework.web.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -226,6 +225,10 @@ public class UrlPathHelper {
|
||||
if (servletPath == null) {
|
||||
servletPath = request.getServletPath();
|
||||
}
|
||||
if (servletPath.length() > 1 && servletPath.endsWith("/")) {
|
||||
// Probably on WebSphere: removing trailing slash...
|
||||
servletPath = servletPath.substring(0, servletPath.length() - 1);
|
||||
}
|
||||
return servletPath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user