You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Koci (JIRA)" <de...@myfaces.apache.org> on 2010/02/10 13:18:27 UTC

[jira] Commented: (MYFACES-2544) UIViewRoot skips uncorrectly encodeBegin

    [ https://issues.apache.org/jira/browse/MYFACES-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12831966#action_12831966 ] 

Martin Koci commented on MYFACES-2544:
--------------------------------------

This is probably bug in spec. https://javaserverfaces.dev.java.net/nonav/docs/2.0/javadocs/javax/faces/component/UIViewRoot.html says: "Upon return from the listener, call FacesContext.getResponseComplete() and FacesContext.getRenderResponse(). If either return true set the internal state flag to true. ... Execute any processing for this phase if the internal state flag was not set." But this nonsence for render response phase, because FacesContext.renderResponse() = "Signal the JavaServer faces implementation that, as soon as the current phase of the request processing lifecycle has been completed, control should be passed to the <em>Render Response</em> phase, bypassing any phases that have not been executed yet."

Delivering PreRenderComponentEvent is ok, because spec says:
"encodeBegin() must publish a PreRenderComponentEvent" or "PreRenderComponentEvent indicates that the source component is about to be rendered". UIViewRoot is UIComponent too and there is no reason to act differently (although PreRenderViewEvent and PreRenderComponentEvent attached to UIViewRoot have same meaning).

> UIViewRoot skips uncorrectly encodeBegin
> ----------------------------------------
>
>                 Key: MYFACES-2544
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2544
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-2
>         Environment: myfaces trunk
>            Reporter: Martin Koci
>            Assignee: Jakob Korherr
>             Fix For: 2.0.0-beta-2
>
>         Attachments: MYFACES-2544.patch
>
>
> javax.faces.component.UIViewRoot.encodeBegin(FacesContext) contains:
> if (!skipPhase) {
>    super.encodeBegin(context);
> }
> but skipPhase = context.getRenderResponse() || context.getResponseComplete() - it
> makes sense for all phases except render response phase itself. That condition
> probably should be:
> if (!context.getResponseComplete()) {
>             super.encodeBegin(context);
> }

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