7 Replies Latest reply on Feb 4, 2008 5:39 AM by F BI

    Can't get the Seam Exception Handling feature to work.

    William Huang Newbie

      I try to setup Seam to handle all JSF exceptions and redirect to a generic error page, but still when exceptions occur, it is not redirecting in to my generic error page.

      Based on the Seam doc, I config my exceptions.xml in WEB-INF

      <!DOCTYPE exceptions PUBLIC
       "-//JBoss/Seam Exceptions Configuration DTD 1.1//EN"
       "http://jboss.com/products/seam/exceptions-1.1.dtd">
      
      <exceptions>
       <exception>
       <redirect view-id="/error/error.xhtml">Unexpected failure</redirect>
       <end-conversation/>
       </exception>
      
      </exceptions>

      and on web.xml
      <!-- =================================================================== -->
       <!-- Seam -->
       <!-- =================================================================== -->
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
      
       <!-- Propagate conversations across redirects -->
       <filter>
       <filter-name>Seam Redirect Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>Seam Redirect Filter</filter-name>
       <servlet-name>Faces Servlet</servlet-name>
       </filter-mapping>
      
       <!-- Needed to ensure safe tx cleanup when using Seam-managed sessions/persistence contexts -->
       <filter>
       <filter-name>Seam Exception Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>Seam Exception Filter</filter-name>
       <url-pattern>/*</url-pattern>
       </filter-mapping>