• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts client and server side validation

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to struts.Sorry for asking this basic question.Generally there will two validations client side and server side validation.From my understanding ,in struts bean class we use validate method to validate which is server side validation. The second one , we have the validation.xml file in which we specify the fields to be validated which is client side validation. Is my understanding correct ?

Thanks in advance.

regards
Ashwin
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Data comes from client and validated at two places as you said. But client side validation is just what happens in validate method. Server side is through validation.xml, but here you (may) have different validations, hence it is not same as what happens validate method.
 
ashwin bala
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mr.Sharma
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Par Sharma wrote:But client side validation is just what happens in validate method. Server side is through validation.xml, but here you (may) have different validations, hence it is not same as what happens validate method.



Not quite. validation.xml configures the ValidationInterceptor for a particular action. It is invoked as part of the interceptor stack as Struts handles the request. The validate method is invoked on the action after the ValidationInterceptor but before execute(). It is possible to tell Struts to use client-side validation, but it is not performed by default. If it is turned on, it uses the same validation.xml file that the ValidationInterceptor uses.
See the Standard Validation and Client Side Validation documentation for more information.
reply
    Bookmark Topic Watch Topic
  • New Topic