| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value={PARAMETER,METHOD})
@Retention(value=RUNTIME)
@Documented
public @interface ModelAttribute
Annotation that binds a method parameter or method return value
 to a named model attribute, exposed to a web view. Supported
 for RequestMapping annotated handler classes.
 
Can be used to expose command objects to a web view, using
 specific attribute names, through annotating corresponding
 parameters of a RequestMapping annotated handler method).
 
Can also be used to expose reference data to a web view
 through annotating accessor methods in a controller class which
 is based on RequestMapping annotated handler methods,
 with such accessor methods allowed to have any arguments that
 RequestMapping supports for handler methods, returning
 the model attribute value to expose.
| Optional Element Summary | |
|---|---|
|  String | valueThe name of the model attribute to bind to. | 
public abstract String value
The default model attribute name is inferred from the declared attribute type (i.e. the method parameter type or method return type), based on the non-qualified class name: e.g. "orderAddress" for class "mypackage.OrderAddress", or "orderAddressList" for "List<mypackage.OrderAddress>".
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||