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

Validators per method

elbek kamoliddinov

Joined: Dec 29, 2009
Posts: 3
Hi I'm using Struts 2.2.
Is there any way to organize validatprs per method
I have a and 2 method 1-add(), 2-edit()
and i want to use 2 diffrent validators.
How can i do it?
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

From the validation documentation:

Defining Validation Rules

Validation rules can be specified:

1. Per Action class: in a file named ActionName-validation.xml
2. Per Action alias: in a file named ActionName-alias-validation.xml
3. Inheritance hierarchy and interfaces implemented by Action class: XWork searches up the inheritance tree of the action to find default validations for parent classes of the Action and interfaces implemented

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Validators per method
It's not a secret anymore!