Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validate() method & validation.xml

 
Rajni Patel
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to use validate() method and validation.xml both with the same action form with different field, but only validate() method populate but validation.xml rule is not populate. Please anybody could guide me?

for ex: I have
String name,
double salary

2 fields.

I validate name with validate() method and salary with validation.xml
so only from validate() method, name field validate but not salary.

So I am thinking validation.xml and validate() method both can not use for the same action form.
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rajni..

I dont think so.

You can use both the validation.xml and the validate() method.

Validate() method is more of server side validation and <Action Name>-validation.xml serves the purpose for both..

but if you are using validation.xml then you dont need to use validate() as it serves the same purpose.


 
Rajni Patel
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for Reply.


I can not populate both validation. If I comment validate() method then from validation.xml validation is working.

Is there I have to configure any thing special?

Thanks again.
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
show me your validation.xml....

Are you using same type in validation.xml as your property type?
 
Rajni Patel
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are write. It is not same. but if comment validate() method then why is it working?

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic