-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: HibernateSessionRequestFilter Exception Handling
PostPosted: Thu Nov 08, 2007 10:03 am 
Newbie

Joined: Tue May 17, 2005 8:55 am
Posts: 11
Hi,

i have a major problem with the exception-handling in the HibernateSessionRequestFilter.

Hibernate version: 3.2 Core
Struts version: 1.2
Tiles version: 1.1
Tomcat version: 5.5

I found the following entry with additional comments in the wiki:
http://www.hibernate.org/43.html

Everything works fine for except one thing:
Displaying the exception to the user.

I tried the following approaches:
1. Adding <%@ page buffer="128kb" autoFlush="false"%> (Large buffer for testing) to the main tiles-layout jsp and "flush=false" in every tiles-insert.
2. Adding this code to the catch-block in the filter:
HttpServletRequest req = (HttpServletRequest) request;
RequestDispatcher rd = req.getRequestDispatcher("/staticContent.do?def=page.exception");
rd.forward(request, response);


This still causes that the next jsp called in the struts forward is rendered even if a database-exception happens and the redirect is called in the filter. Additionally a "java.lang.IllegalStateException: Cannot forward after response has been committed" is thrown but this has no impact on the rendered jsp.

I also tried the approach, described in the wiki-comment, which suggest to add a addErrorMessage method to add struts-action-errors to the session if a exception is thrown in the filter. This doesn't work for me too.

As far as i can see there is no way for me to direct to a error page after chain.doFilter(request, response); is called in case an exception occurs.

Any help or suggestions for me? THX in advance!


Top
 Profile  
 
 Post subject: No solution?
PostPosted: Mon Nov 12, 2007 5:09 am 
Newbie

Joined: Tue May 17, 2005 8:55 am
Posts: 11
So..
No way to display an error-message for failed transactions to the user in a hibernate/struts/tomcat environment?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.