Ok to call UIViewRoot.encdeBegin/encodeEnd if request is Ajax request.
It's UIViewRoot.encodeChildren where the partial render (traversal) is done.
All test continue to run.
Index: UIViewRoot.java
===================================================================
--- UIViewRoot.java (revision 5971)
+++ UIViewRoot.java (working copy)
@@ -935,11 +935,6 @@
* that occur during invocation of any of the the beforePhase
* listeners must be logged and swallowed. After listeners are invoked
* call superclass processing.</p>
- * <p class="changed_added_2_0">If {_at_link
- * javax.faces.context.PartialViewContext#isAjaxRequest} returns
<code>true</code>,
- * perform partial view rendering as defined by the installed
- * {_at_link javax.faces.application.PartialTraversal} strategy.
- * </p>
*/
@Override
public void encodeBegin(FacesContext context) throws IOException {
@@ -947,9 +942,7 @@
notifyBefore(context, PhaseId.RENDER_RESPONSE);
if (!skipPhase) {
- if (!context.getPartialViewContext().isAjaxRequest()) {
- super.encodeBegin(context);
- }
+ super.encodeBegin(context);
}
}
@@ -983,15 +976,8 @@
}
/**
- * <p class="changed_added_2_0">If {_at_link
- * javax.faces.context.PartialViewContext#isAjaxRequest} returns
<code>true</code>,
- * perform partial view rendering as defined by the installed
- * {_at_link javax.faces.application.PartialTraversal} strategy.
- * If {_at_link
- * javax.faces.context.PartialViewContext#isAjaxRequest} returns
- * <code>false</code>, override the default
- * {_at_link UIComponentBase#encodeEnd} behavior. If
- * {_at_link #getAfterPhaseListener} returns
+ * <p class="changed_added_2_0">
+ * If {_at_link #getAfterPhaseListener} returns
* non-<code>null</code>, invoke it, passing a {_at_link PhaseEvent}
* for the {_at_link PhaseId#RENDER_RESPONSE} phase. Any errors that
* occur during invocation of the afterPhase listener must be
@@ -999,9 +985,7 @@
*/
@Override
public void encodeEnd(FacesContext context) throws IOException {
- if (!context.getPartialViewContext().isAjaxRequest()) {
- super.encodeEnd(context);
- }
+ super.encodeEnd(context);
notifyAfter(context, PhaseId.RENDER_RESPONSE);
}