• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception handling in web involves Spring Hibernate and Struts

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to know what is the better approach for handling exception.
My web project is having Struts-Spring and Hibernate.
I am following the below coding style.




An exception can occur eitehr at Struts Action or Biz Layer or at Data Layer.
For suppose in Data Layer, I am getting the duplicate excepion from DB what will be better approach to handle it. Whether I need to send it back the same exception to Biz layer and then to Action and display it to the user.
Also, how can I handle different exceptions to the user. For example while the user trying to add a new employee details, duplicate error might come and on what basis I can get the error and display it the user appropriately .
Since I will be configuring exception in applicationContext.xml in transaction for rollback/commit, i want to handle it correctly.
Please advice on the better approach in handling the exception for the above model. thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic