1 Reply Latest reply on Nov 4, 2007 4:39 PM by Pete Muir

    problem with @Redirect

    John McClain Newbie

      here is my custom exception

      @ApplicationException
      @Redirect(viewId="genericErrorPage.xhtml")
      public class FraudException extends Exception {
       public FraudException(){}
      }
      

      here is my genericErrorPage.xhtml
      .
      .
      .
      <body>
      <h:messages
       globalOnly="true"
       styleClass="message"
       id="globalMessages" />
      </body>
      
      </html>
      


      here is where I throw it:
      private void doQry(String qry) throws FraudException {
       Connection con = null;
       Statement st = null;
      
       try {
       con = ds.getConnection();
       st = con.createStatement();
       ResultSet rs = st.executeQuery(qry);
       caseList.clear();
       while (rs.next()) {
       caseList.add(new Tblcase(rs.getObject(1), rs.getObject(2), rs
       .getObject(3), rs.getObject(4), rs.getObject(5), rs
       .getObject(6), rs.getObject(7), rs.getObject(8), rs
       .getObject(9), rs.getObject(10), rs.getObject(11), rs
       .getObject(12)));
       }
       } catch (Exception e) {
       e.printStackTrace();
       log.error("ERROR: " + e.getMessage());
       facesMessages.add("ERROR RENDERING DATA: " + e.getMessage());
       throw new FraudException();
       } finally {
       try {
       con.close();
       st.close();
       } catch (Exception e) {
       e.printStackTrace();
       log.error("ERROR: " + e.getMessage());
       facesMessages.add("ERROR CLOSING CONNECTIONS: " + e.getMessage());
       throw new FraudException();
       }
       }
      


      Why does the SEAM.debug (or facelets.debug - not sure which) come up when I deliberately force an exception instead of my genericErrorPage.xhtml?