Hi all,
I am using
Struts 1.2.9 and I have a question. We have a set of code that has had many different people working on it and everyone sadly does their own interpretation of how to validate with Struts.
Mainly we try to use the Struts validator by simply defining the validation rules in the validation.xml file. We have created a bunch of custom validation which we call from the validation.xml file and this works great.
In areas where we have felt that the validwhen would be too complicated to write in the xml file we have added custom validation in the validate() method in the Form class.
To do this we then usually write our own checks (length, type etc) with normal
java code, example:
if (str.length() > <somevalue>
{
errors.add(<someerror>
;
}
What I would like to do is to call the same method that the Struts framework calls (i.e. the ones defined in the org.apache.struts.validator.FieldChecks class) when it checks the validations defined in the xml file but I am not getting this to work as I want. The main thing is that I don't know how to get the "correct" arguments from my validate() method. There are a bunch of arguments that are sent to the validateXXX() methods in the FieldChecks class and I would like to be able to provide these as well, either that or be told how to do something to the effect I am hoping for.
Any help or pointers are welcome.
Thanks in advance,
Archie