@Retention(value=RUNTIME) @Target(value={PARAMETER,FIELD,ANNOTATION_TYPE}) public @interface Bind
Bind annotation is used to specify a
binding from a group of HTTP parameters to an action
handler method parameter, controller field or
an annotation| Modifier and Type | Required Element and Description |
|---|---|
Class<? extends Binder>[] |
value
Specify the
Binder implementations
**Note** each binder implementation must have different
Binder.targetType() |
public abstract Class<? extends Binder>[] value
Binder implementations
**Note** each binder implementation must have different
Binder.targetType()public abstract String model
HTML code
<form>
<input name="u.name">
<input name="u.password" type="password" >
</form>
Java code
public Result createUser(@Binder(value = UserBinder.class, model = "u") User user) {
...
}
If model is ignored, then implementation should use the
parameter name (user) in our case to resolve the model instance; and
the frontend developer shall not use u.name and u.password to refer
the model, instead user.name and user.password shall be used
Copyright © 2017. All Rights Reserved.