Announcement Announcement Module
No announcement yet.
User-friendly message when exception thrown on binding Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • User-friendly message when exception thrown on binding

    Spring 1.2.3

    I am trying to figure out how to display a user-friendly message when an exception is thrown from my command object on binding. I have already figured out how to display user-friendly messages when validation fails. That is not the issue. Here's a little more detail.

    My setter throws an exception if a certain business rule fails. But when the form is re-displayed, I get an ugly message like this: Property startDate threw exception; nested exception is com.bennettsworld.careermanager.exceptions.StartDa teLaterThanEndDateException: Start date must be earlier than the end date.

    How can I tie this into my ResourceBundleMessageSource? This is not a typeMismatch or required message. This is a business rule message. So I'm a little confused as to how this is done.

    Any tips you can provide are greatly appreciated. Thank you in advance.