-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Closed
Copy link
Labels
status: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement
Description
Marten Deinum opened SPR-10913 and commented
Currently it is possible to add the @ModelAttribute annotation on an argument in a method annotation with @ModelAttribute. This can lead to suprising results especially when there are multiple @ModelAttribute annotated methods.
@ModelAttribute
public Foo foo() {
}
@ModelAttribute
public Bar bar(@ModelAttribute foo) {
}
Method bar depends on foo but the execution of these methods differs from time to time.
There are 2 possible solutions I see
- The order of execution needs to be fixed and determined at startup/runtime, check for dependencies between methods.
- Don't allow this (
@ModelAttributeon an attribute of a@ModelAttributeannotated method)
I would suggest option 2.
Affects: 3.2.4
Reference URL: http://stackoverflow.com/questions/18783842/annotation-modelattribute-order-of-invocation-methods/18784052
Issue Links:
- Support for @ModelAttribute interdependency [SPR-6299] #10965 Support for
@ModelAttributeinterdependency ("duplicates")
Metadata
Metadata
Assignees
Labels
status: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement