Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.0-alpha
-
None
-
Running Trinidad 2.0.x; with Facelets; no Partial State Saving and using JSF Ajax request rather than the Trinidad PPR mechanism
Description
1. Download the patch onto your Trinidad 2.0.x branch (minus the ResponseWriter class changes). Run the page ajaxPPRDemos.jspx. Click on the "Partial Submit" button which posts back to the server using the JSF Ajax communication channel rather than the trinidad. Notice the UnsupportedOperationException.
java.lang.UnsupportedOperationException
at javax.faces.context.ResponseWriter.endCDATA(ResponseWriter.java:212)
at javax.faces.context.ResponseWriterWrapper.endCDATA(ResponseWriterWrapper.java:183)
at javax.faces.context.PartialResponseWriter.endUpdate(PartialResponseWriter.java:208)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit
(PartialViewContextImpl.java:494)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback
(PartialVisitContext.java:175)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1443)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1454)
2. It looks like JSF 2.0 added new methods startCDATA() and endCDATA() methods, which need to be used by the trinidad ResponseWriterDecorator and other implemetations of ResponseWriter.
3. the ReponseWriter fixes patch makes the following fixes:
ResponseWriterDecorator.java (now extends ResponseWriterWrapper. Ideally we should remove ResponseWriterDecorator entirely and just use JSF2.0 ResponseWriterWrapper)
HtmlResponseWriter.java (overrides 2 new methods sneakily added to javax.faces.context.ResponseWriter but never really gives a compilation error).
XmlResponseWriter.java (same as above)
XhtmlResponseWriter.java (do)
Note that under normal circumstances these exceptions are not seen. Only when testing with JSF 2.0 Ajax.