remove trailing servlet path slash on WebSphere only (SPR-7064)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3274 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2010-04-20 11:15:47 +00:00
parent eba93732a2
commit 8b8d06ab4c
@@ -233,8 +233,10 @@ public class UrlPathHelper {
if (servletPath == null) {
servletPath = request.getServletPath();
}
if (servletPath.length() > 1 && servletPath.endsWith("/")) {
// Probably on WebSphere: removing trailing slash...
if (servletPath.length() > 1 && servletPath.endsWith("/") &&
request.getAttribute(WEBSPHERE_URI_ATTRIBUTE) != null) {
// On WebSphere, for a "/foo/" case that would be "/foo" on all other servlet containers:
// removing trailing slash, proceeding with that slash as final path mapping...
servletPath = servletPath.substring(0, servletPath.length() - 1);
}
return servletPath;