• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Validator frameork in struts  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have few questions regarding validator framework.

1. In struts we can do both server and client side validation so wats the diff btwn two? can i apply all validations at client side?
2. So in the client side validations, <html:javascript formName=" LoginBeanName" /> and <html:form action="LoginAction.do" onSubmit=”return validateLoginFormBean(this);”> are the only tags which i need to add in jsp page.
3. In case of server side validation, can i validate the data from Database? Can i do this? for eg if i want to check whether the user entered fake or existing bank account number?

Please reply... i am very confused ...

Thanks
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all both the validations are important i.e., both client and server side. If you just do client side validation then there is a high possibility that you might get data that is not validated because in client-side validation you need Javascript and if you turn it off then there will never be a validation done. So both the server and client side is important.

Yes you have to apply the 2 tags you mentioned for client-side validation

yes you can validate on the server-side with your data in database. you can return the same page if there are any validation errors by mapping it. like if there is fake account or duplicate bank account number.


 
Tulip Jain
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot jinal ... it helped a lot... after your post i did some practice on validation and concept is clear now .... but i have only doubt remaining is that whatever validations we configure for client side same validations applies to server side in the configuration files. There is no way in the configuration files, where we can seperate the validations for client side and for server side....
 
Jinal Prakas Shah
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tulip I am glad that I could help. There is a way to separate validations in both server-side and client-side. If you want to have extra-validations on either of the sides here's the trick. For client side you have to code specially and write in Javascript and for server-side you have code and write the flow in your action class method.

Regards
 
Tulip Jain
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Jinal .... i really appreciate your replies ....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!