• Post Reply Bookmark Topic Watch Topic
  • New Topic

validations in struts  RSS feed

 
sree rao
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why should we go for serverside validations in struts when
<html:javascript tag is available to client side.
Any other reason except that password validations or any other validations which are interact with database)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on your intended audience.

If you're making an app for the general public like an E-Bay or Amazon, you will want it to work in as many browsers as possible. Some people use out of date browsers. Some disable javascript. Some will do everything they can to crack your app. In these cases, if you're only validating on the client with Javascript your validation will never be run. Without some kind of server-side check, you could end up with all kinds of junk data in your app.

On the other hand, if you're building an intranet or corporate app and you have control over which browsers your app will support, client side validation may be sufficient.

Now that MSIE and Mozilla/Firefox both support the same Document Object Model (DOM) it's a lot easier to move functionality to the client.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!