Hi All,
I am currently experimenting on the Spring MVC by trying out some simple exercise.
I have this scenario in my mind, suppose I want to validate something using the onsubmit method of the simpleformcontroller.
In this case, I want to check if the commandclass value is correct and if there is something wrong, I want to display the form again
with form:errors.
Thru some experiment I was able to come up with below code. I call the showform on the onsubmit method. My question is, is this the right
way to do what I want. I am not sure if this is efficient or not.
By the way, here's my another question. Given below scenario, should it be much better If I transfer below code in the validator class?
I currently used my validator class in validating for empty space which I can do also with javascript.
I want to ask those experts in spring if its alright to put all of your business logic validation in the Validator class? I am currently reluctant to
add
JDBC and DAO calls in my validator. I wanted to hear if those who have created full grown enterprise application in spring has been doing these.
Thanks and looking forward to your responses.