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

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3325 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2010-05-12 20:15:40 +00:00
parent 220d5a0e15
commit 2472c22298
@@ -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);
}
}