• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

validations in struts

 
Greenhorn
Posts: 29
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai friends,

I am working on struts validation

validation.xml file is



And my action form is




For validating we are use validate.xml file right...?
but why we need to use validate method in action form

please tell me......

thanq in advance
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

haritha hari wrote: why we need to use validate method in action form



You do not. I find it useful to do simple validation with XML validation (see if a required field is filled in) and more complex validation in the Java code (make sure a field is in a set of values).
You can also create your own validators to take care of more complex cases.
 
Greenhorn
Posts: 25
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Haritha

As i know, we use validate.xml (or any name like validator-user.xml....) to configure the dynamic validator plugin generated validation rules.
Struts supplied validator plugin provides approx 14 validation rules. But moreover if we need our manual validation rules along with validator
plugin supplied validation rules then for this purpose we can write our own logic in action form class validate(--) method.
If you are in no need of your own manually developed validation rules, there is no need of taking the validate(--) method in your action form class.

I hope this will help you

 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic