I have a Spring Mvc 3 form, which is POST for the controller, in the controller I make calls to execute DML statements. I also have a separate validation class that implements Validator and is called in my controller. I perform a simple as well as a complex check, for example, checks if the username exists and returns an error message if it exists.
I would like to use ajax to validate only the username field when I exit the field in the view, but I would like to make a call to the already implemented validation that I have and only validate the username.
How can I achieve this, I need to make an Ajax call for the Controller class and have a separate @RequestMapping to handle this only? Can I give an example of how this should be implemented.
source share