return LoginDTO.class.equals(clazz);
}
@Override
public void validate(Object target, Errors errors) {
LoginDTO loginDTO = (LoginDTO) target;
String username = loginDTO.getUsername();
if (ValidateUtil.isEmptyText(username)) {
errors.rejectValue("username", null, "Username must not be empty!");
}
String password = loginDTO.getPassword();
if (ValidateUtil.isEmptyText(password)) {
errors.rejectValue("password", null, "Password must not be empty!");
}
}