I want to pass a value to my own validation method. Basically i want to do the same thing as mask or minlength where you tell it a variable name and value. Anyone know how i can access a variable defined in this way?
Stu Johns wrote:I want to pass a value to my own validation method.
Which validation method you're using, is it ValidatorForm#validate() method OR Validator Plugin(validator.xml). In former case, you can pass the name=value parameters using 'request' object and accessing them "validate()" method, this is my wild guess and you may not get any success. In later case I don't think we can do this OR I don't know.
Meanwhile, why do you want to this complications ?
I wanted to try and use the validation.xml approach.
It was purely from an educational point of view, I didnt know if it was possible or if the mask validation (and other struts inbuilts) was a special case.
hmm hard to do, but there are NO classes I saw in Struts API which can have an access to validatore.xml which returns the <field> element,t still have look at this method, may this methods put some light. OR I don't know much about your requirement
You may be right David, but the thing is I didn't understand the authors requirement, and what I concluded finally was, the author want to get the <var-name> and <var-value> from validator.xml for the specific bean/form.