My Applicatoin is based on Spring 3, Hibernate, JSP and MySQL DB
While registering user, I want to check if username exists in DB. What is the best way to achieve this? can someone please provide example or reference to other posts?
I have tried below stuff so far
On submit of a page, I have a service call in controller which returns user object (if username exists) otherwise null. i.e. “public User userService.getUser(userName)”
- I dont know how to pass the message to jsp so posting this message
- I am not sure if this is the correct approach? of not please suggest
better one
I’ll make a
ajaxcall to check the existence of user by calling the this function inside the controller, and display the appropriate message if the user already exist.