Checking the Email Field

I am new to Java EE and I wanted to know which of the following will execute faster, Javascript or code written in a servlet?

Context: validation of the regular expression in the email field.

+5
source share
2 answers

JavaScript client side validationso it will be faster. But if javascript is disabled in the browser, it will not perform validation.

Servletswill be server side validations. It will be less fast, but will always be more accurate when checking fields.

+1
source

definitely javascript. This is a client-side check, and the browser itself can handle this. No need to go to the servlet.

-1
source

All Articles