Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to easily reverse 'ignoreDefaultModelOnRedirect' default when using mvc:annotation-driven [SPR-8801] #13443

Closed
spring-projects-issues opened this issue Oct 26, 2011 · 4 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Mike Youngstrom opened SPR-8801 and commented

In Spring 3.1 a new option was added to disable automatically adding model attributes to a redirect. This option was turned on by default in mvc:annotation-driven. This breaks backwards compatibility of applications that are using annotation-driven and model attributes on redirect. This if fine since the new default is better. However, there is no easy way for annoation-driven users to revert to the old mechanism. It would be nice if there was an easy way to reverse this backwards incompatible change. Perhaps by adding an attribute to annoation-driven to restore the old functionality?


Affects: 3.1 RC1

Referenced from: commits 8889284

@spring-projects-issues
Copy link
Collaborator Author

Mike Youngstrom commented

One thought. Though this solution may be too out of the norm and confusing for people you could use the old default if the schema version is 3.0 and use the new default if the schema version is 3.1. That would work for my projects here since they don't usually upgrade schema versions unless they need to. I think an attribute to enable it or disable it would still be needed but if you wanted to push new projects to start with this disabled this is one way you could do it.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Interesting suggestion although it still leaves the question of backwards compatibility. I think we can keep the option turned off in the mvc namespace maintaining backwards compatibility along with a flag to change it. The MVC Java config on the other hand can have the flag on without breaking compatibility.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

The flag has been added. For example:

<mvc:annotation-driven ignoreDefaultModelOnRedirect="true" />

The default value for both the MVC namespace the Java config is now "false" in order to maintain backwards compatibility and provide consistency across the various configuration options.

Although technically the MVC Java conifg could use "true" as the default value without breaking compatibility, it could still lead to issues for anyone switching from explicit configuration or from the MVC namespace to the MVC Java config.

@spring-projects-issues
Copy link
Collaborator Author

Mike Youngstrom commented

Thanks Rossen!

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.1 RC2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants