Search code examples
jsf-2web.xmlmyfaces

Apache MyFaces ERROR_HANDLING Context Parameter VS javax.faces.PROJECT_STAGE


Could anyone verify that these context parameters are equivalent?

It would appear that setting javax.faces.PROJECT_STAGE to 'Development' has the same effect as setting org.apache.myfaces.ERROR_HANDLING to 'true'.

I have seen plenty of examples where jacax.faces.PROJECT_STAGE and/or faces.DEVELOPMENT are explicitly set to FALSE whilst org.apache.myfaces.ERROR_HANDLING is set to TRUE.

First impressions suggest that the initial setting of FALSE is redundant and I would speculate that the use of PROJECT_STAGE is better since it is agnostic to specific implementations of the JSF Specification?

Thanks

<context-param>
        <param-name>
            org.apache.myfaces.ERROR_HANDLING
        </param-name>
        <param-value>
            true
        </param-value>
    </context-param>

    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
</context-param>

Solution

  • Came across the answer to this in a text book today.

    javax.faces.PROJECT_STAGE instruments the user of ERROR_HANDLING levels.

    Thus they are not equivalent but the use of one brings about the action of the other.

    It was introduced in JSF 2.0.

    Owing to its definition in the API, it is more proper for javax.faces.PROJECT_STAGE to be preferred.