Only enable full path optimization when there's one DispatcherServlet
Previously, UrlPathHelper's full path optimization was enabled when there was a dispatcher servlet mapped to /. The UrlPathHelper is used across Spring MVC and if there are multiple dispatcher servlets they all share the sample UrlPathHelper. This meant that any additional dispatcher servlets mapping to locations other than / would not be able to map requests correctly as the UrlPathHelper would use the full path, ignoring the url mapping of the dispatcher servlet. This commit updates the MVC auto-configuration so that use of the full path is only enabled if there's a single dispatcher servlet registration. Fixes gh-22682
Showing
Please register or sign in to comment