• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling business logic exceptions with Spring MVC

 
joe black
Ranch Hand
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a registerService which throws a RegistrationException if a username or email is already taken. On my registration page, I would like the user to see the message contained within the exception, instead of forwarding them to an error page ( I have seen examples of this ). I am using Spring MVC with a SimpleFormController.
[ November 11, 2006: Message edited by: joe black ]
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe,

See the Exception Handling in Spring MVC - Handling Exceptions

You can use a SimpleMappingExceptionResolver. Something like -


[ November 13, 2006: Message edited by: Sonny Gill ]
 
joe black
Ranch Hand
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would take the user to a different page. I would like a post back to the same form the user came from, with the error message at the top of the page - basically the same behavior as the Validator.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic