Hello yatesco
thanks for the reply,
about the book, well i am starting read the chapter 10 ,
and my unique critic could be for chapter 9 validation, lazy chapter. but the book
was a good adquisition (nothing is perfect
)
well about validation, i thought that was enough with validation
like the example of the chapter 5 of Spring Documentation
but suppose that class Person have 2 more properties type Date called borndate and deaddate (sorry for my grammar)
its obvious that 2 validation could be, if its ( null or blank ) and format for each variable of course
but what about of ranges???, its silly that deathdate could be minor that borndate
so in if in the validation class
Code:
public void validate(Object obj, Errors e) {
ValidationUtils.rejectIfEmpty(e, "name", "name.empty");
Person p = (Person) obj;
if (p.getAge() < 0) {
e.rejectValue("age", "negativevalue");
} else if (p.getAge() > 110) {
e.rejectValue("age", "too.darn.old");
}
if(staticvariabletoglobalclassvalidation.validaterangedates(borndate,deathdate)){ // <--- used by other class validator's
e.rejectValue("borndate", "it imposible live after death");
}
}
}
of course that validaterangedates was made by hand by myself, and other validation methods, using special validations with regex, (check telephones,postal,code etc etc) and used by other class validator's
my point is that i have already written these clases for validation in a work with struts (used how utils class), so i want recicle these clases for Spring mvc, i hope you see my point, (maybe this is your point when you talk about mix )
in my honest opinion i can work in peace with ValidationUtils and Errors using my clases validation
if this logic or way is correct.
is this really your way???, i am little confuse
regards
thanks for advanced
DrPompeii