• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validation Question

 
Tapan Maru
Ranch Hand
Posts: 65
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

Problem description:

I have a registerService which throws a RegistrationException if a username or email already exists in database.
On registration page, when user submits the form,I would like the user to see the message contained within the exception on the same page with the filled data, instead of forwarding them to an error page.

is this possible in spring?? if yes, how?

 
Prasad Krishnegowda
Ranch Hand
Posts: 665
4
Eclipse IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Its possible, No need to throw an exception, take a look at Validator interface in Spring MVC,.. you can just validate the username or email..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic