I'm trying validating my beans using bean validator. The problem is I don't know which libraries(jar) are necessary to validation.
I'm using.
Vaadin 7, BeanFieldGroup and EclipseLink
/** class of MyBean */
public class MyBean{
@Id
@GeneratedValue
private Long id;
@NotNull
@NotEmpty
@Size(min=5, max=50, message="Min = 5 and Max = 50, this field is not empty")
private String name;
@Email
@NotEmpty
private String email;
}
Any idea ?
Follow these step-by-step instructions on how to download and configure Hibernate Validator in your Eclipse project:
validation-api-1.1.0.Final.jar
and hibernate-validator-5.1.0.Final.jar
filesvalidation-api-1.1.0.Final.jar
tree nodevalidation-api-1.1.0.Final-sources.jar
validation-api-1.1.0.Final.jar
tree nodevalidation-api-1.1.0.Final-javadoc.jar
hibernate-validator-5.1.0.Final.jar
In a moment Eclipse is ready to work with Bean Validation constraints.
In fact you could end up the configuration on step 5) as this is all you need to make Bean Validation work, however development is much more comfortable if a given main .jar is associated with its corresponding -javadoc and -sources libraries as it gives you opportunity to:
respectively for the selected constraint in Eclipse Java Editor.
Now, imagine you can achieve the same with a single step (well, almost) using Maven but that's another story for another time...