MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-1297

Redirect to a JSF page when Throwable exception or error occur

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.7
    • Component/s: None
    • Labels:
      None

      Description

      This issue was originally open as MYFACES-1889 but this enhancements should be here.

      One possible enhancement to the error handling feature of myfaces could be the capability of redirect to a jsf page.

      I have studied the issue in deep and the thing could be as described below:

      1. Add this configuration to WEB-INF/web.xml

      <context-param>
      <description>
      Handle exceptions with jsf redirect page.
      </description>
      <param-name>org.apache.myfaces.ERROR_HANDLING_REDIRECT_PAGE</param-name>
      <param-value>true</param-value>
      </context-param>

      2. Define a navigation rule like this:

      <navigation-rule>
      <from-view-id>*</from-view-id>
      <navigation-case>
      <from-outcome>java.lang.NullPointerException</from-outcome>
      <to-view-id>/nullErrorPage.jsp</to-view-id>
      </navigation-case>
      </navigation-rule>

      Note that in from-outcome there is defined the class name of the error to be redirected by this page.

      The first test of this feature has been successful, but there are some questions to be solved:

      1. How to add error information (maybe add as a value on the request scope like exceptionList)
      2. How to handle multiple errors, maybe the best is use a special outcome like org.apache.myfaces.MultipleThrowable

      I'll do some test this weekend and add a possible patch of this feature.

      1. nullPage.jsp
        4 kB
        Leonardo Uribe
      2. patchErrorRedirect.patch
        72 kB
        Leonardo Uribe

        Activity

        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Leonardo Uribe made changes -
        Fix Version/s 1.1.7-SNAPSHOT [ 12312361 ]
        Fix Version/s 1.1.7 [ 12313398 ]
        Leonardo Uribe made changes -
        Resolution Fixed [ 1 ]
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Fix Version/s 1.1.7-SNAPSHOT [ 12312361 ]
        Leonardo Uribe made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Leonardo Uribe made changes -
        Attachment nullPage.jsp [ 12385823 ]
        Leonardo Uribe made changes -
        Field Original Value New Value
        Attachment patchErrorRedirect.patch [ 12385822 ]
        Leonardo Uribe created issue -

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Leonardo Uribe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development