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

master
Juergen Hoeller 15 years ago
parent 3f6cc3f552
commit 69c4cdf975
  1. 6
      org.springframework.web/src/main/java/org/springframework/web/util/UrlPathHelper.java

@ -233,8 +233,10 @@ public class UrlPathHelper {
if (servletPath == null) { if (servletPath == null) {
servletPath = request.getServletPath(); servletPath = request.getServletPath();
} }
if (servletPath.length() > 1 && servletPath.endsWith("/")) { if (servletPath.length() > 1 && servletPath.endsWith("/") &&
// Probably on WebSphere: removing trailing slash... 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); servletPath = servletPath.substring(0, servletPath.length() - 1);
} }
return servletPath; return servletPath;

Loading…
Cancel
Save