The current reactive implementation of RedirectView makes the assumption that the application context will always contain an implementation of RequestDataValueProcessor, which does not seem to be true. Actually it is not RedirectView to be blamed but its parent AbstractView. But using RedirectView seems to be the most common way of being hit by this issue.
The RedirectView#createUrl(...) method does this just after building the URL and before returning it:
Note that the code above unconditionally calls ApplicationContext#getBean(String,Class<?>), which will throw NoSuchBeanDefinitionException if there is no RequestDataValueProcessor registered.
In contrast, see how this is done at the MVC side, at the non-reactive RedirectView#updateTargetUrl(...) method, which calls the RequestDataValueProcessor only if it exists in the application context.
Daniel Fernández opened SPR-15136 and commented
The current reactive implementation of
RedirectView
makes the assumption that the application context will always contain an implementation ofRequestDataValueProcessor
, which does not seem to be true. Actually it is notRedirectView
to be blamed but its parentAbstractView
. But usingRedirectView
seems to be the most common way of being hit by this issue.The
RedirectView#createUrl(...)
method does this just after building the URL and before returning it:See it here on Github
Given
RedirectView
extends fromAbstractView
, this calls theAbsctractView#getRequestDataValueProcessor()
method, which looks like this:See it here on GitHub
Note that the code above unconditionally calls
ApplicationContext#getBean(String,Class<?>)
, which will throwNoSuchBeanDefinitionException
if there is noRequestDataValueProcessor
registered.In contrast, see how this is done at the MVC side, at the non-reactive
RedirectView#updateTargetUrl(...)
method, which calls theRequestDataValueProcessor
only if it exists in the application context.See it here on GitHub.
Affects: 5.0 M4
Referenced from: commits 8b7f3a6
The text was updated successfully, but these errors were encountered: