Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best ways of performing server side validations on data using Java

Could someone guide me on this fundamental question: What are the best way ways of performing server side validations on data using Java?

I would like to know if there are open source libraries available to perform server side validations as well.

Any help is appreciated.

like image 856
Khushroo Mistry Avatar asked Dec 28 '22 23:12

Khushroo Mistry


1 Answers

It depends on which web developement framework you are using.


Raw JSP Servlet

If you are using simple jsp servlet, Then I would suggest add one validator package/jar for each form/jsp screen. and validate it from controller before passing to service.


JSF

If you are using JSF then there is very well designed validation phase provided , You can use ready made validators (you can just add annotation on the form field and its done) or you can create your own validators also.


Spring MVC

If you are using Spring MVC , it has also got a saperate layer for validation.


Struts

Struts has also got saperate layer for validation

like image 156
jmj Avatar answered Feb 23 '23 09:02

jmj