1 Reply Latest reply on Jan 26, 2009 4:06 AM by Nick Belaevski

    Exception handling. Why AjaxViewRoot not rethrow exceptions?

    Vladimir Petrukhin Newbie

      Hi! I already asking about it in previous topics. No answers.

      This method should rethrow catched exception, because other servlet filters must be awared about it:

      public void processEvents(FacesContext context,

      EventsQueue phaseEventsQueue, boolean havePhaseEvents) {
      FacesEvent event;
      while (havePhaseEvents) {
      try {
      event = (FacesEvent) phaseEventsQueue.remove();
      UIComponent source = event.getComponent();
      try {
      source.broadcast(event);
      } catch (AbortProcessingException e) {
      if (_log.isErrorEnabled()) {
      UIComponent component = event.getComponent();
      String id = null != component ? component
      .getClientId(context) : "";
      _log.error(
      "Error processing faces event for the component "
      + id, e);
      }
      }
      } catch (NoSuchElementException e) {
      havePhaseEvents = false;
      }
      }
      }

        • 1. Re: Exception handling. Why AjaxViewRoot not rethrow excepti
          Nick Belaevski Master

          Hello,

          Here is excerpt from UIViewRoot, Sun RI JSF 1.2_11:

          while (!eventsForPhaseId.isEmpty()) {
           FacesEvent event =
           eventsForPhaseId.get(0);
           UIComponent source = event.getComponent();
           try {
           source.broadcast(event);
           } catch (AbortProcessingException e) {
           if (LOGGER.isLoggable(Level.SEVERE)) {
           UIComponent component = event.getComponent();
           String id = "";
           if (component != null) {
           id = component.getId();
           if (id == null) {
           id = component.getClientId(context);
           }
           }
           LOGGER.log(Level.SEVERE,
           "error.component.abortprocessing_thrown",
           new Object[]{event.getClass().getName(),
           phaseId.toString(),
           id});
           LOGGER.log(Level.SEVERE, e.toString(), e);
           }
           }
           eventsForPhaseId.remove(0); // Stay at current position
           }
          no exception is available to servlet. Can you please point to JSF specification part stating that this exception should be available?