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
The redirect included the context path of the application: "promo". However in Spring 3.0.4, we've found that we've had to go through and change all the redirects to exclude the context path. So now our redirect looks like:
I suspect that this has something to do with the 3.0.4 changes in RedirectView which recently got reverted to the 3.0.3 version as part of #12148. There were no other changes in RedirectView since 3.0 RC1, so I can't imagine any other reason. If you could give a recent 3.0.5 snapshot a try and check whether the problem remains there, that would be great!
A special note: It looks like the only reason why it did work for you with 3.0.2 is that your path starts with " /" instead of "/". "redirect:" URLs are defined to be context-relative by default, unless your ViewResolver is configured with "redirectContextRelative"="false". However, there is a getUrl().startsWith("/") check, so the prepended blank in your URLs might have been a workaround for that - and it's likely that 3.0.4 accidentally broke that workaround. It's probably better to configure this at the ViewResolver level, even if 3.0.5 allows for the workaround again...
Grant Gochnauer opened SPR-7532 and commented
In Spring 3.0.2, our MVC controllers returned a redirect view via the XML definition as follows:
The redirect included the context path of the application: "promo". However in Spring 3.0.4, we've found that we've had to go through and change all the redirects to exclude the context path. So now our redirect looks like:
So we had to remove the context path from the redirect. Is it correct that we'd normally want to include a context path when issuing a redirect call?
Thank you!
Affects: 3.0.4
Issue Links:
The text was updated successfully, but these errors were encountered: