1 Reply Latest reply on Jun 26, 2010 6:20 AM by jonssonth

    Getting handle to exception object

      Hi,

      I am using pages.xml to redirect to a global error.xhtml on the event of an exception.

          <exception>
              <redirect view-id="/error.xhtml">
                   <message severity="error">System is experiencing technical difficulty</message>
              </redirect>
          </exception> 

      I am associating each exception with a unique reference number and need to display it on the error.xhtml. How can I get a handle to the exception object on the error.xhtml.
      I tied a backing bean to that page and tried displaying the below

      log.info("org.jboss.seam.caughtException: " + Contexts.getConversationContext().get("org.jboss.seam.caughtException"));
      log.info("org.jboss.seam.caughtException (Component.getInstance): " + Component.getInstance("org.jboss.seam.caughtException"));
      log.info("org.jboss.seam.handledException: " + Contexts.getConversationContext().get("org.jboss.seam.handledException"));

      But all the above components were null.

      Also tried the below in pages.xml, this too didn;t work.

         <exception>
              <redirect view-id="/error.xhtml">
                  <message severity="warn">#{handledException.message}</message>
              </redirect>
          </exception>

      Is this a defect in Seam ? am using 2.2.0 GA.

      facelets.development and seam.debug are set to false.
      The error.xhtml page is displayed but i need to get a handle to the exception object.

      Any help will be appreciated.

      Thanks,
      Pravin.