0 Replies Latest reply on Feb 28, 2012 12:29 AM by kamal_khadka

    SevletException

    kamal_khadka

      In pages.xml I have

       

      <exception class="javax.servlet.ServletException">

              <redirect view-id="/error.xhtml">

              </redirect>

          </exception>

      and error.xhtml is as follow

       

      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

                            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <ui:composition 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"

                      template="layout/home.xhtml">

       

      <ui:define name="body">

          <h1>#{messages.error_server}</h1>

          <p>#{messages.error_unkownError}</p>

          <p>#{messages.error_tryAgain}<br/></p>

         

      <h:messages styleClass="message"/>       

      </ui:define>

      </ui:composition>

       

      So if there is an error. Error page is shown which displays the detail of error. I want to automatically email this to me so I will be able to see what error the users are seeing. I was able to make it send email when error.xhtml is rendered. I want to catch the stackTrace when there is an error and get that emailed to me.

       

      My question is how would I be able to catch the error. I hope I am clear with my problem.