@Retention(value=RUNTIME) @Target(value={PARAMETER,FIELD,ANNOTATION_TYPE}) public @interface Bind
The Bind annotation is used to specify a binding from a group of HTTP parameters to an action handler method parameter, controller field or another annotation
public abstract Class<? extends Binder>[] value
Specify the Binder implementations
Note each binder implementation must have different Binder.targetType()
public abstract String model
Optionally specify the model attribute name the binder should used to resolve request parameters into the domain model object. Example:
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 © 2014–2018 OSGL (Open Source General Library). All rights reserved.