File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes validator framework in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validator framework in struts" Watch "validator framework in struts" New topic
Author

validator framework in struts

ravindrasingh bist
Greenhorn

Joined: Sep 26, 2005
Posts: 1
In my jsp i have two button

one is Search which will find the name in data base and if present it will get data and display in jsp

the other one is Add which will add data to database

i am using validator framework and i have define some validation
but my poblem is that these validation work on search also but that i dont want

when i click on search only one validation should work

and when i click on ADD all validation should work

how to do this

please help me
Ergin Er
Ranch Hand

Joined: Sep 06, 2005
Posts: 60
If you're just using validation for checking if inserted string matches the maxlength or correct characters, you can use validator.xml to set up validation for the form property (text field) you want to validate. Than you don't even need the validate method in your form.
This is just for standard validations only (using regular expressions). If you want to do an advanced validation, than you can use the standard validate method in the form, all you need to do there is don't compare your search field with any requirements (than it wont validate it )
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validator framework in struts
 
Similar Threads
Regarding validations part of Struts...
unable to trigger javascript validation
Hibernate Validator...
Help regarding struts validator framework (version 1.2.7)
Unclear on what's happening with validation