Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
440 views
in Technique[技术] by (71.8m points)

java - client side validation doubts

I have read from one of the blog, for security reasons, its suggested to do the input data validation at the server side not the client side.

From the above statement, My mind started to ask then 1) what kind of validation i can do with JS in the client side. 2) Is there any rule where any programmers can decide where the validation needs to be performed, whether at the client side or the Server side?

I am building Java based web application

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can do any kind of validation on the client, but you must never rely on that validation.

For UI purposes it is often a good idea to validate on the client since the response time is faster. But since the user can always turn off client side validation (e.g. by turning off JavaScript), you must never rely on it to actually have been performed and re-validate your input on the server.

In general, if the checks are critical to security, don't do it on a system the user can control.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...