Remove deprecated setIgnoreDefaultModelOnRedirect#3868
Merged
strehle merged 8 commits intocloudfoundry:developfrom May 8, 2026
Merged
Remove deprecated setIgnoreDefaultModelOnRedirect#3868strehle merged 8 commits intocloudfoundry:developfrom
strehle merged 8 commits intocloudfoundry:developfrom
Conversation
This method was removed in Spring Framework 6.0 without replacement. The default model is now always ignored on redirect. This requires changes to some controllers where model.addAttribute() was used that now won't be delegated. We need to use redirectAttributes.addAttribute().
2a19b9e to
09e513e
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Removes usage of Spring MVC’s deprecated setIgnoreDefaultModelOnRedirect(false) and updates redirect flows to explicitly use RedirectAttributes so request parameters reliably propagate on redirects under Spring Framework 7.x behavior.
Changes:
- Removed
RequestMappingHandlerAdapter#setIgnoreDefaultModelOnRedirect(false)initialization from app and multiple MVC test configurations. - Updated
LoginInfoEndpoint#discoverIdentityProviderto useRedirectAttributesfor redirect parameters (email/username/login_hint/discoveryPerformed). - Updated
InvitationsControllererror redirect path to useRedirectAttributesfor redirect parameters.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/test/java/org/cloudfoundry/identity/uaa/login/ResetPasswordControllerViewZonePathTests.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/login/ResetPasswordControllerTest.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/login/ProfileControllerMockMvcZonePathTests.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/login/ProfileControllerMockMvcTests.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/login/LoginInfoEndpointTests.java | Updates tests to pass RedirectAttributes for discovery redirects. |
| server/src/test/java/org/cloudfoundry/identity/uaa/login/HomeControllerViewZonePathTests.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/login/HomeControllerViewTests.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/login/ChangeEmailControllerTest.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/login/AccountsControllerTest.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/invitations/InvitationsControllerZonePathTest.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/invitations/InvitationsControllerTest.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/account/ChangePasswordControllerViewZonePathTests.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/account/ChangeEmailControllerViewZonePathTests.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/test/java/org/cloudfoundry/identity/uaa/account/AccountsControllerViewZonePathTests.java | Removes test-only configuration that changed redirect model behavior. |
| server/src/main/java/org/cloudfoundry/identity/uaa/web/WebConfig.java | Removes application-level setIgnoreDefaultModelOnRedirect(false) configuration. |
| server/src/main/java/org/cloudfoundry/identity/uaa/login/LoginInfoEndpoint.java | Uses RedirectAttributes to carry redirect parameters explicitly. |
| server/src/main/java/org/cloudfoundry/identity/uaa/invitations/InvitationsController.java | Uses RedirectAttributes to carry redirect parameters on error reload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
this is used in other places. Maybe it is better all to be refactored to redirectAttributes, but let's not do this now.
5aaaaa6 to
3940385
Compare
Contributor
|
Review copilot feedback |
- Remove unconditional loginHint Model population in discoverIdentityProvider - Only add loginHint to Model when returning view (UAA password page) - Keep RedirectAttributes for redirect query parameters - Prevents unit tests from validating wrong mechanism since Spring 7+ ignores Model on redirects Fixes issue where Model attributes were being set but ignored on redirect responses.
`discoverIdentityProviderCarriesLoginHintIfProvided` is already covered by `discoverIdentityProvider_addsAllRedirectAttributesOnFallthrough` that also verifies the other attributes
`discoverIdentityProviderCarriesEmailIfProvided` is already covered by the combined test `discoverIdentityProvider_addsAllRedirectAttributesOnFallthrough`
Indeed, we are guaranteed to be in the UAA case, so we can remove it..
strehle
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This method was deprecated in Spring Framework 6.x without replacement. The default model is now always ignored on redirect. The method was removed in Spring Framework 7.x.
This requires changes to some controllers where
model.addAttribute()was used that now won't be delegated. We need to useredirectAttributes.addAttribute()https://github.com/spring-projects/spring-framework/blob/cf727bd7c80881864a941933fa6fb890b37de470/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java#L488-L503