aspose file tools*
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
Author

Validators per method

elbek kamoliddinov
Greenhorn

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 MainAction.java and 2 method 1-add(), 2-edit()
and i want to use 2 diffrent validators.
How can i do it?
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8910
    
    8

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


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validators per method