1 Reply Latest reply on Aug 9, 2011 4:52 AM by Adrien Adrien

    userexceptions redirect to different error page

    veera k Newbie

      We have a requirement where in we have to show different error pages for some of the usecases.

      Right now I am throwing different exceptions in the places where we need to show a different error page.

      As part of error handling approach our web.xml has following entries,

       

      web.xml

      <error-page>
          <exception-type>com.test.X1Exception</exception-type>
          <location>/X1error.jsf</location>
      </error-page>

      <error-page>
          <exception-type>com.test.X2Exception</exception-type>
          <location>/X2error.jsf</location>
      </error-page>

      <error-page>
          <exception-type>javax.faces.application.FacesException</exception-type>
          <location>/error.jsf</location>
      </error-page>

       

      But I am getting redirected to error.jsf no matter what the exception I throw.

      I tried extending Exception or FacesException or RuntimeException in X1/X2Exception class, but no matter what I do I always get redirected to error.jsf

      Could somebody suggest better way to deal with this situation.

      I am using JSF1.2 and richfaces 3.3.0 versions

       

      Thanks,

      Veera