0

I have two fields time in and time out I want to validate the time out so it will not accept a value less than the value of time in ex the time in is 9:15 the time out shouldn't accept a value of 9:00 or less

@Column(name="timein")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern="MM/dd/yyyy HH:mm")
    @NotBlank
    private Date timeIn;

    @Column(name="timeout")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern="MM/dd/yyyy HH:mm")
    @NotBlank
    private Date timeOut;

And one more is for the confirm password field how can I validate that the two match?

@NotBlank
  private String password;

  @NotBlank 
  private String confirmPassword;
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Ian Santos
  • 127
  • 1
  • 2
  • 11

1 Answers1

0

Implement Validator and add a validate method that verifies what you want. Call the validate method from your submit method.

ghenghy
  • 361
  • 1
  • 5