1 Reply Latest reply on May 15, 2008 10:24 PM by Tom Goring

    Seam managed exception handling and stacktrace

    Benjamin Graf Novice

      As far as I understand the functionality of seam managed exception handling via pages.xml to redirect to somathing like an error.xhtml there is no posibility to also print the error stacktrace on the view beside enabeling debug page.

        • 1. Re: Seam managed exception handling and stacktrace
          Tom Goring Apprentice

          If you look at the wiki source it may help... I noticed


          ./examples/wiki/view/message.xhtml:



          <html xmlns="http://www.w3.org/1999/xhtml"
                      xmlns:s="http://jboss.com/products/seam/taglib"
                      xmlns:ui="http://java.sun.com/jsf/facelets"
                      xmlns:f="http://java.sun.com/jsf/core"
                      xmlns:h="http://java.sun.com/jsf/html"
                      xmlns:wiki="http://jboss.com/products/seam/wiki">
          
          <head>
              <title><h:outputText value="#{messages['lacewiki.label.Message']}"/></title>
          </head>
          <body>
          
          <div id="messageBox">
              <h:messages/>
          </div>
          
          <s:fragment rendered="#{init.debug}">
              Exception Details:
              <hr/>
          
              <s:div id="stackTraceHandled">
                  Handled exception:
                  <pre style="font-size:75%;">
          
          Top level exception : #{org.jboss.seam.handledException.class.name}: #{org.jboss.seam.handledException.message}
          =========================================================================================================================
          <ui:repeat value="#{org.jboss.seam.handledException.stackTrace}" var="stackElement">
          #{stackElement}</ui:repeat>
          
          Root cause exception: #{wiki:unwrap(org.jboss.seam.handledException).class.name}: #{wiki:unwrap(org.jboss.seam.handledException).message}
          =========================================================================================================================
          <ui:repeat value="#{wiki:unwrap(org.jboss.seam.handledException).stackTrace}" var="stackElement">
          #{stackElement}</ui:repeat>
          
          </pre>
                  <hr/>
              </s:div>
          
              <s:div id="stackTrace">
                  Unhandled or wrapper exception:
                  <pre style="font-size:75%;">
          
          Top level exception : #{org.jboss.seam.exception.class.name}: #{org.jboss.seam.exception.message}
          =========================================================================================================================
          <ui:repeat value="#{org.jboss.seam.exception.stackTrace}" var="stackElement">
          #{stackElement}</ui:repeat>
          
          Root cause exception: #{wiki:unwrap(org.jboss.seam.exception).class.name}: #{wiki:unwrap(org.jboss.seam.exception).message}
          =========================================================================================================================
          <ui:repeat value="#{wiki:unwrap(org.jboss.seam.exception).stackTrace}" var="stackElement">
          #{stackElement}</ui:repeat>
          
          </pre>
                  <hr/>
              </s:div>
          
          </s:fragment>
          
          </body>
          </html>