[jboss-user] [JBoss Seam] - Default Exception Handler doesn't work

gingming do-not-reply at jboss.com
Wed Mar 28 21:22:10 EDT 2007


I've the following in the pages.xml:


  | 	<exception>
  | 		<end-conversation />
  | 		<redirect view-id="/error.xhtml">
  | 			<message>Unexpected Failure. Cause: #{handledException.message}</message>
  | 		</redirect>
  | 	</exception>
  | 

However, when exception occurred, it couldn't catch it and tries to redirect the user to the debug.xml page.

I then added

  | 	<exception class="org.jboss.seam.InstantiationException">
  | 		<end-conversation />
  | 		<redirect view-id="/error.xhtml">
  | 			<message>Unexpected Failure. Please check the system configuration. Cause: #{handledException.message}</message>
  | 		</redirect>
  | 	</exception>
  | 
to catch the exception throw.  It can now redirect correctly, however, it couldn't get the message out from the handledException object.

I've added the following filter in my web.xml:

  | 	<filter>
  | 		<filter-name>SeamExceptionFilter</filter-name>
  | 		<filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
  | 	</filter>
  | 
  | 	<filter-mapping>
  | 		<filter-name>SeamExceptionFilter</filter-name>
  | 		<url-pattern>*.xhtml</url-pattern>
  | 	</filter-mapping>
  | 

I've also tried with the org.jboss.seam.web.SeamFilter but the same problem occurs.

Are there still bugs in the exception handling mechanism or is my configuration incorrect?  I'm using Seam 1.2.1.GA, however, when it starts up, it still displays 

29 Mar 2007 12:32:44,389 | 0           [INFO ] {main} (javax.servlet.ServletContextListener) Welcome to Seam 1.2.0.PATCH1
  | 
in the Eclipse IDE Console output.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032596#4032596

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032596



More information about the jboss-user mailing list