[JAVASERVERFACES-3151] PartialViewContextImpl doesn't leverage VisitContextFactory for PartialVisitContext so it disallows to use VisitContextWrappers Created: 21/Jan/14  Updated: 27/Mar/14  Resolved: 22/Jan/14

Status: Closed
Project: javaserverfaces
Component/s: context
Affects Version/s: 2.2.5
Fix Version/s: 2.2.6

Type: Bug Priority: Major
Reporter: lfryc Assignee: Manfred Riem
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File changebundle.txt    


There is a following invocation in #processPartial method:

PartialVisitContext visitContext = new PartialVisitContext(context, phaseClientIds, hints);
PhaseAwareVisitCallback visitCallback = new PhaseAwareVisitCallback(ctx, phaseId);
component.visitTree(visitContext, visitCallback);

PartialVisitContext is instantiated directly here instead of leveraging VisitContextFactory.

This basically disallows use of VisitContextWrapper as a way of enriching tree traversal performed by PartialViewContext's.

In RichFaces we could replace ExtendedPartialViewContext concept by VisitContext wrapper with same functionality, leveraging Mojarra PVCImpl. This can lower the number component-library inter-operability issues and make partial view rendering less error-prone for developers.

Note: MyFaces leverages VisitContextFactory correctly:

VisitContext visitCtx = getVisitContextFactory().getVisitContext(_facesContext, executeIds, PARTIAL_EXECUTE_HINTS);
viewRoot.visitTree(visitCtx, new PhaseAwareVisitCallback(_facesContext, phaseId));

Comment by lfryc [ 21/Jan/14 ]

Link to MyFaces impl:

I wonder, is there any reason why Mojarra doesn't leverage VisitContextFactory?

Comment by Ed Burns [ 22/Jan/14 ]

Nice, Thanks Manfred and Lukas. I hope you are well. Are you coming to JavaLand?


Comment by Manfred Riem [ 22/Jan/14 ]

Applied to 2.2 branch,

svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-3151, r=edburns, make sure PartialViewContext can be wrapped"
Sending jsf-ri/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
Transmitting file data .
Committed revision 12781.

Comment by Manfred Riem [ 22/Jan/14 ]

Thanks Lukas!

Comment by lfryc [ 23/Jan/14 ]

Hey Manfred, Ed,
thanks for prompt feedback and the fix!

Comment by bleathem [ 23/Jan/14 ]

Thanks guys!

Does it make sense to apply this fix to the 2.1 branch as well?

Comment by lfryc [ 27/Jan/14 ]

Hi Manfred,

I get ClassCastException with the fix before when custom VisitContextFactory is used.

I have created a new issue to address that:

Comment by Manfred Riem [ 27/Jan/14 ]

If a back port to 2.1 is needed please file a task requesting a back port. Thanks!

Comment by bleathem [ 28/Jan/14 ]

I've created JAVASERVERFACES-3157 to address back-porting this fix to JSF 2.1.

Generated at Sat Dec 10 14:44:10 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.