Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.0.1-incubating-core-SNAPSHOT
-
None
-
None
-
trinidad trunk and 1.2 branch, facelets 1.1.12, jsf ri 1.2.03
Description
Currently it does not seem to be possible to use trinidad with jsf1.2
ri and facelets and not having trinidad declared as default rendering
kit.
Removing
<default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-id>
from faces-config.xml and adding the render kit declaration to the view root
<f:view ... renderKitId="org.apache.myfaces.trinidad.core">
will break the view handling process with the following error:
java.lang.IllegalStateException: No RenderingContext
at org.apache.myfaces.trinidad.render.CoreRenderer.encodeBegin(CoreRenderer.java:159)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeBegin(UIXComponentBase.java:668)
at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1209)
at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:721)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:182)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
After doing some debuging, I came to the conclusion that this must be
due to the trinidad ViewHandlerImpl.renderView() method
implementation. The problem is the way the ViewHandlerImpl wraps the
delegate, but needs to setup the RenderingContext before the delegate
is executed. Creating the RenderingContext is currently done by
CoreRenderKit.encodeBegin(). But this won't never happen in this case,
because facelets did not parse the page including the <f:view
renderKitId..> element yet, so we don't know which render kit to use
before calling the facelets delegate!
So here's whats happening in ViewHandlerImpl:
160: ExtendedRenderKitService cannot be found because trinidad is not
the default anymore
172: CoreRenderKit will not be called to setup RenderingContext (thread local)
182: delegation to FaceletViewHandler
afterwards
org.apache.myfaces.trinidad.render.CoreRenderer.encodeBegin(CoreRenderer.java:159)
fails on non initialized thread local.
What do you think? Is there a chance to reimplement
ViewHandlerImpl.renderView() so this problem could be resolved? Any
possible side effects?
Reference to trinidad-dev thread:
http://mail-archives.apache.org/mod_mbox/incubator-adffaces-dev/200702.mbox/%3cde8e1ae30702150604o21fc69e4j528b7ab617b3b47b@mail.gmail.com%3e