Which check to use

I am working on a J2EE web application

We are using JSP and Struts here

I know I can use

  • Client side validation (using JavaScript)

  • Server side validation (using validation framework)

My question is which path is more correct and should be used in the application and why?

+2


source to share


1 answer


You must use both .

Server side validation is required so that no one can exploit malformed queries and access your data. You have to do server side validation because anyone can make bad requests to your page directly (instead of going through your client scripts)



Client side validation is only about helping innocent users submit correct data in case they make a mistake that would cost a whole trip to the server and reload the page, which would be detected and rendered differently.

+5


source







All Articles