File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Regarding validation_rules.xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Regarding validation_rules.xml file " Watch "Regarding validation_rules.xml file " New topic

Regarding validation_rules.xml file

Johnson David

Joined: May 22, 2005
Posts: 27
Hi All,

We all know that validation_rules.xml file contains all the validation functions like date,credit card,email etc.

My question is , Can we add our own functions to that file ?

If so, what is the procedure ?

thanks in advance,

Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 138
Yes you can very well do that.
Just define your own validating class and declare it in validator-rules.xml

you have to mention in the validator tag like this

<validator name="myvalidationrule"
methodParams="list of parameters"

in validation.xml say
<field property="blahblahblah" depends="myvalidationrule"></field>

Paras Jain
SCJP 5.0
I agree. Here's the link:
subject: Regarding validation_rules.xml file
It's not a secret anymore!