Java Reference
In-Depth Information
:"+cons.getRootBeanClass()+",Instance :
"+cons.getLeafBean()+", "
+ " attribute :
As we mentioned, the Bean Validation Specification can be combined with other spe-
cifications. In the example that follows, we present the coupling between Bean Val-
idation and JSF. We take this opportunity to highlight automatic validation. The ex-
ample that follows demonstrates how to validate the input of a student in our online
preregistration website:
public class InscriptionBean {
@Size(min=4, message="The full name must have
"+ " at least four characters!")
private String name;
private Date birthday;
@Size(min=1, max=1,message="Enter only one
private String gender;
]?(\\d{3})[- ]?(\\d{4})$",
message="Invalid phone format, should be as
@Size(max = 10)
private String phone;
message="Invalid email")
Search WWH ::

Custom Search