NimazSheik
NimazSheik

Reputation: 51

Adding spring to servlet just for validation

I am currently not using any frameworks (other than bootstrap) for my java-ee application. But i came across a problem in using server side validation for servlets. I am finding it difficult to implement validation like this http://spring.io/guides/gs/validating-form-input/ I could use request dispatcher, but I am not sure if it's the right way. So i wanted to ask is it advisable to use the spring framework just for the validation? is there any way to convert my entire java application to use spring or should i build the application from the ground up again?

Upvotes: 0

Views: 81

Answers (1)

Ralph
Ralph

Reputation: 120811

If you just need the validation, then I recommend to use JSR-303/349 Bean Validation 1.0/1.1. The default implementation is done by Hiberante-Validator (this is NOT the Hibernate-ORM project!). It is relative easy to use out of the box.

http://hibernate.org/validator/documentation/getting-started/

Upvotes: 1

Related Questions