This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
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

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
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: 9169

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!