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

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


Copy link

@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:


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

Referenced from: commits 2295372, cfe2af7

1 votes, 4 watchers

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
in: web type: enhancement
None yet

No branches or pull requests

2 participants