You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to this commit, the URL handler mapping would expose the matching
pattern, the path within mapping and matching URI variables as request
attributes. This was the case when the mapping would use the
`AntPathMatcher` as matching infrastructure, but not when using the
`PathPattern` variant. In this case, the map of URI variables would be
`null`. This could throw `IllegalArgumentException` when `RedirectView`
instances were relying on the presence of specific variables.
This commit ensures that URI variables are also extracted when the
`PathPatternParser` is used.
Fixesspring-projectsgh-33422
Affects: 6.1.2+ (probably since the introduction of PathPatterns)
When you use a
RedirectView
with an URI that contains a path variable, andPathPattern
s are enabled, then the variable value is missing.This is due to the fact that the
PathPattern
codepath ofAbstractUrlHandlerMapping
is calling buildPathExposingHandler() with uriTemplateVariables parameter of null.As a consequence no
PathExposingHandlerInterceptor
is added to the execution chain. The variable values are never parsed from the URI.When
RedirectView
tries to access the variable values of the variables in the URI at replaceUriTemplateVariables() it throws an IllegalArgumentException.When
AntPattern
s are used instead ofPathPattern
s, then the variable values are parsed and all is well.The text was updated successfully, but these errors were encountered: