I use an ExceptionHandlerInterceptor which wraps around all other interceptors and the action/view invocation. It logs the exception as SEVERE (which causes the logging handler to send me an email) and shows the ERROR page defined in xwork.xml to the user. This setup allows me to use an error page appropriate for the area of the site that caused the error. eg all errors that occur in the flight booking section go to a flight-error page.
----- Original Message ----- From: "Jason Carreira" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, February 22, 2004 1:54 PM Subject: RE: [OS-webwork] Hibernate adminApp's interceptor You could just let the error go through to the Servlet container and it will display an error page. Otherwise, you could add an error message to the Action to be displayed to the user. > -----Original Message----- > From: Erik Jõgi [mailto:[EMAIL PROTECTED] > Sent: Saturday, February 21, 2004 6:00 PM > To: [EMAIL PROTECTED] > Subject: [OS-webwork] Hibernate adminApp's interceptor > > > hello, > > I had a look at Hibernate's adminApp regardig Hibernate > session/ transaction handling. > > In the adminApp the transaction is commited (which also calls > flush()) in the HibenateInterceptor after the invocation. I > think this is not > the best solution because flush() and the actual commit() are > places where most of the database related exceptions might > occur and when > they do the interceptor is unable to communicate the failiure to the > user as the view is already rendered. > > I asked about this at the Hibernate forum and Gavin replied that > actually the best place for that code would be in the > beforeResult() method of the interceptor. When I do this and > an exception occurs > in my beforeResult() implementation, what is the best way to > handle that? How to communicate that failiure back to the > client as there > is no way I can change the action's result? > > Also are there any other ways people are using Hibernate in WW2? > > One way I can think of is to use Spring's HibernateTemplate > in the action's code... > > any comments on this topic are greatly appreciated > > best regards, > erik > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=1356&alloc_id=3438> &op=click > > _______________________________________________ > > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=ick _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork