Announcement Announcement Module
Collapse
No announcement yet.
Catching Hibernate Exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Catching Hibernate Exception

    Hi,

    I am using Hibernate for Database Access. I have a single controller for doing both 'add' and 'edit' to database and the controller extends SimpleFormController. To place a command object in session i used controller's formBackingObject() method. In that method i tried to retrieve an object from database by the object_ID to put it to the command object. But if there is no object found for that given object_ID then an exception occur. I become able to catch the exception but cannot showing the error in a specified view page.

    How can i show that error in my specified page.

    Mamun

  • #2
    Just rethrow the error (or convert it to something more sensible) and attach a so-called HandlerExceptionResolver. There's more info on those thingies in the docs, section 12.9

    cheers,
    Alef

    Comment


    • #3
      Its very cool and nice solution.
      Thanks Alef.............

      Mamun

      Comment

      Working...
      X