Browse Source

MVC mappings properly apply even to welcome file entries that forward to a DispatcherServlet (SPR-7143)

pull/1234/head
Juergen Hoeller 15 years ago
parent
commit
a1e4f4f406
  1. 6
      org.springframework.web/src/main/java/org/springframework/web/util/UrlPathHelper.java

6
org.springframework.web/src/main/java/org/springframework/web/util/UrlPathHelper.java

@ -158,8 +158,10 @@ public class UrlPathHelper { @@ -158,8 +158,10 @@ public class UrlPathHelper {
else {
// Special case: URI is different from servlet path.
// Can happen e.g. with index page: URI="/", servletPath="/index.html"
// Use servlet path in this case, as it indicates the actual target path.
return servletPath;
// Use path info if available, as it indicates an index page within
// a servlet mapping. Otherwise, use the full servlet path.
String pathInfo = request.getPathInfo();
return (pathInfo != null ? pathInfo : servletPath);
}
}

Loading…
Cancel
Save