开发者

What validation should I use

I am working on a J开发者_开发知识库2EE 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜