1 Reply Latest reply on Sep 19, 2012 8:00 AM by Kayaman

    javax validation

      I have integrated javax validation with my swing app.
      class Department{
              private String name;
              private String code;
           public String getName(){..}
      TextField Name;
      TextField code;
      On textfield focus change I want to validate department pojo. If Name field size is below 8 I want to focus the Name textfield.
      Set<ConstraintViolation<Department>> violations = validator.validate(department);
      Using this code I could get all the errors found.
      Question) I don't know how to write the code which will tell me Name field entry is wrong. I want to get the textfield name so that I could focus that textfield
      Question) Do we use javax validation for this purpose, or do we use to check if entire pojo is correct before submitting.