[JAVASERVERFACES_SPEC_PUBLIC-762] Only short-circuit a non-faces request to render response if view metadata has no children Created: 06/Mar/10  Updated: 01/Aug/14  Resolved: 08/Jun/11

Status: Closed
Project: javaserverfaces-spec-public
Component/s: Lifecycle
Affects Version/s: 2.0
Fix Version/s: 2.2

Type: Bug Priority: Critical
Reporter: mojavelinux Assignee: Ed Burns
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: 22 hours, 11 minutes
Time Spent: 1 hour, 49 minutes
Original Estimate: 1 day
Environment:

Operating System: All
Platform: All


Attachments: Text File changebundle.txt     Zip Archive JAVASERVERFACES_SPEC_PUBLIC-762.zip    
Issue Links:
Dependency
blocks JAVASERVERFACES_SPEC_PUBLIC-758 Support view actions that execute bef... Closed
Related
is related to JAVASERVERFACES-3118 Migrate test for spec issue 762 to te... Closed
Issuezilla Id: 762
Status Whiteboard:

size_medium importance_medium


 Description   

Currently, on an non-faces request, the Restore View short-circuits to the
Render Response if the view metadata contains no UIViewParameter children. The
exclusive check in this logic breaks the whole extensibility of the view
metadata feature.

Consider that a component author creates a custom component to be used in the
view metadata. Now, the page author has to add add least one (perhaps arbitrary)
UIViewParameter in the view metadata in order for view metadata to go through
the full JSF lifecycle, and the custom component activated, on an initial
request.

Here is the correct logic for the Restore View phase:

viewRoot = metadata.createMetadataView(facesContext);
// Only skip to render response if there are no child components
UIComponent metadataFacet = viewRoot.getFacet(UIViewRoot.METADATA_FACET_NAME);
if (metadataFacet.getChildCount() == 0) {
facesContext.renderResponse();
}

As a workaround, a component author could decorate the createMetadataView call
and add a artificial UIViewParameter if other children are present (though
setting it up would require a lot of work).



 Comments   
Comment by Ed Burns [ 17/May/10 ]

Move to 2.1

Comment by Ed Burns [ 22/Jun/10 ]

sheetalv

Comment by rogerk [ 27/Oct/10 ]

triage

Comment by Ed Burns [ 06/Jun/11 ]

Bulk assign all of Sheetal's spec issues to me.

Comment by Ed Burns [ 08/Jun/11 ]

Committed to trunk.

Sending jsf-ri/src/main/java/com/sun/faces/lifecycle/RestoreViewPhase.java
Sending jsf-ri/systest/build-tests.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/build.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/pom.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/java/com
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/java/com/sun
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/java/com/sun/faces
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/java/com/sun/faces/regression
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/java/com/sun/faces/regression/i_spec_762
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/java/com/sun/faces/regression/i_spec_762/Issue762PhaseListener.java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/java/com/sun/faces/regression/i_spec_762/UserBean.java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/webapp
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/webapp/WEB-INF
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/webapp/WEB-INF/faces-config.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/webapp/WEB-INF/web.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-762/i_spec_762_war/src/main/webapp/main.xhtml
Sending jsf-test/build.xml
Transmitting file data ..........
Committed revision 9143.

Comment by Manfred Riem [ 01/Aug/14 ]

Closing resolved issue out

Generated at Fri Mar 06 22:00:39 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.