Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-576

improved integration with view-controller

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6
    • 0.7
    • JSF-Module
    • None

    Description

      currently there is no proper handling of exceptions in @PreRenderView callbacks

      with that it's e.g. possible to use:

      @ExceptionHandler
      public class ErrorViewAwareExceptionHandler {
          @Inject
          private ViewConfigResolver viewConfigResolver;
      
          public void onIllegalStateException(@Handles ExceptionEvent<IllegalStateException> e)
          {
              FacesContext facesContext = FacesContext.getCurrentInstance();
      
              String viewId = viewConfigResolver.getDefaultErrorViewConfigDescriptor().getViewId();
              UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);
              facesContext.setViewRoot(viewRoot);
              //... - e.g.: store the exception in a page-bean for the default-error-view
          }
      }
      

      later on we could support it out-of-the-box - e.g. via something like:

          @ErrorView(forException = {IllegalStateException.class})
          class Error extends DefaultErrorView {}
      

      Attachments

        Activity

          People

            gpetracek Gerhard Petracek
            gpetracek Gerhard Petracek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: