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

Value-oriented return method handling broken in 3.1 [SPR-9218] #13856

Closed
spring-projects-issues opened this issue Mar 10, 2012 · 1 comment
Closed
Assignees
Labels
in: web type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Mar 10, 2012

Jiří Vypědřík opened SPR-9218 and commented

I've noticed a significant difference in processing of controller methods introduced in 3.1, what stops me from migration from 3.0.

In 3.0, method return values were observed to determine the appropriate handler. Using this feature, it was possible to define the method as returning Object and return anything appropriate for particular case: String with view name, concrete View instance, Custom object serialized to JSON, etc.

Starting from 3.1, not the method return value but rather the declared method return type is taken into account, thus killing such a beautiful feature. According to the handler matching chain, for the Object return value, only the fallback handler for binding return values to model attributes is triggered.

Please get this feature back!!!


Affects: 3.1.1

Reference URL: http://forum.springsource.org/showthread.php?124126-Spring-3-1-breaks-usual-return-value-handling-scheme&p=404866#post404866

Sub-tasks:

  • #14256 Backport "Value-oriented return method handling broken in 3.1"

Referenced from: commits 2295372, cfe2af7

1 votes, 4 watchers

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 12, 2012

Rossen Stoyanchev commented

Yes indeed decisions are now made based on the return type from the method signature rather than the actual value. We'll see what we can do to address this. In the mean time, you can continue to use the AnnotationMethodHandlerAdapter even in Spring 3.1, which should give you the exact existing behavior. See the reference docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants