Question

I am working on a J2EE web application

Here we are using JSP and Struts

I know one can use

  1. Client side validation (Using JavaScript)

  2. Server side validation (Using Validation framework)

My question is which way is more proper and one should use in application and why?

Was it helpful?

Solution

You have to use both.

Server side validation is required so that nobody can use malformed queries and gain access to your data. You must do server side validation because anybody can submit malformed queries to your page directly (rather than going through your client side scripts)

Client side validation is only to help innocent users submit correct data in case they were making a mistake which would have cost an entire trip to the server and a page reload to be detected and displayed otherwise.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top