jsp - Which is best to use Validation server side or client side -


as in few days planning starting our web-based appplication, can state me best of them giving same in various form's , login page.

what validation?

validation process of testing , ensuring user has entered required , formatted information through web form.

what client-side validation?

in client-side validation method, input validations , error recovery process carried out on client side i.e on user’s browser. can done using javascript, ajax, html5 etc.

what server-side validation?

in server-side validation, input validations , error recovery process carried out on server side. can done using programming languages c#.net, vb.net etc.

differences , comparison:

client-side validation faster server-side because, validation takes place on client side (on browser) , networking time client server saved.

on other hand, server-side validation done on web server. server renders data html page , sends client (browser).

server-side validation more secure client-side user cannot see code view-source.

client side

you want validate input on client side first because can give better feedback average user. example, if enter invalid email address , move next field, can show error message immediately. way user can correct every field before submit form.

if validate on server, have submit form, error message, , try hunt down problem.

(this pain can eased making "sticky" forms server remembers entered in each field , fills in, client-side validation still faster.)

server side

you want validate on server side because can protect against malicious user, can bypass javascript , submit dangerous input server.

it dangerous trust ui. not can abuse ui, may not using ui @ all, or browser. if user manually edits url, or runs own javascript, or tweaks http requests tool? if send custom http requests curl, example?

not allowing not naive security standpoint, non-standard: client should allowed send http whatever means wish, , should respond correctly. includes validation.

server side validation important compatibility - not users have javascript enabled.

conclusion:

both validation methods have own significance. recommend should use both validation methods client-side validation provide better user experience , server-side sure input client (browser) validated , not supposed validated client.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -