You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2008/07/11 04:17:31 UTC

[jira] Created: (TOMAHAWK-1297) Redirect to a JSF page when Throwable exception or error occur

Redirect to a JSF page when Throwable exception or error occur
--------------------------------------------------------------

                 Key: TOMAHAWK-1297
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1297
             Project: MyFaces Tomahawk
          Issue Type: New Feature
            Reporter: Leonardo Uribe
            Assignee: Leonardo Uribe


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.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TOMAHAWK-1297) Redirect to a JSF page when Throwable exception or error occur

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-1297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated TOMAHAWK-1297:
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.1.7-SNAPSHOT
           Status: Resolved  (was: Patch Available)

After review it, it was added a config parameter org.apache.myfaces.ERROR_REDIRECT_ALTERNATE_HANDLER
so if an error is not handled by the ErrorRedirectJSFPageHandler, it is possible to redirect to another handler or by default throw and handle as an simple jsp page

> Redirect to a JSF page when Throwable exception or error occur
> --------------------------------------------------------------
>
>                 Key: TOMAHAWK-1297
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1297
>             Project: MyFaces Tomahawk
>          Issue Type: New Feature
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>             Fix For: 1.1.7-SNAPSHOT
>
>         Attachments: nullPage.jsp, patchErrorRedirect.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TOMAHAWK-1297) Redirect to a JSF page when Throwable exception or error occur

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOMAHAWK-1297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated TOMAHAWK-1297:
-------------------------------------

    Status: Patch Available  (was: Open)

> Redirect to a JSF page when Throwable exception or error occur
> --------------------------------------------------------------
>
>                 Key: TOMAHAWK-1297
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1297
>             Project: MyFaces Tomahawk
>          Issue Type: New Feature
>            Reporter: Leonardo Uribe
>            Assignee: Leonardo Uribe
>         Attachments: nullPage.jsp, patchErrorRedirect.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.