Details
Description
If you write an ICEfaces application using Facelets, the context parameter delegateNonIface cannot be set to true of the application will fail. The problem was described in a separate case (ICE-2503) but I will copy and quote the relevant information here:
----
I did finally manage to replicate this issue. I tried the same test case with ICEfaces 1.6.0, 1.6.1, and 1.7 (from the current head of the repository). In addition to the standardRequestScope = true, I also had to have delegateNonIface = true. When these two context parameters are set as indicated, the problem occurs - even in a standard web application (i.e. it is not constrained to portlets).
In 1.6.0, the exception is as indicated in the original report:
java.lang.UnsupportedOperationException
at javax.faces.context.ExternalContext.setResponse(ExternalContext.java:856)
at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:436)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:114)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:150)
In 1.6.1 and 1.7 from the head, the exception is slightly different:
java.lang.ClassCastException: com.icesoft.faces.env.PortletEnvironmentRenderRequest
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:110)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:145)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:145)
The main problem is basically the same, though, and stems from the ViewHandler delegation model. All registered ViewHandlers are put into a non-deterministic chain (a linked list of sorts with no specified order). To make this work, ViewHandlers need to be sure which views they should handle and which they should delegate. By setting delegateNonIface = true, the ICEfaces D2DViewHandler delegates responsibility to Sun's default ViewHandler implementation which, in this case, it shouldn't as we need to do the actual processing in the ICEfaces framework.
So the quick fix is to set delegateNonIface = false. This brings up a separate issue in that the use of delegateNonIface cannot be used with Facelets in ICEfaces. This should be captured in a separate JIRA. If the submitter can verify that the setting the delegateNonIface = false works for their application, the case can be resolved.
---
----
I did finally manage to replicate this issue. I tried the same test case with ICEfaces 1.6.0, 1.6.1, and 1.7 (from the current head of the repository). In addition to the standardRequestScope = true, I also had to have delegateNonIface = true. When these two context parameters are set as indicated, the problem occurs - even in a standard web application (i.e. it is not constrained to portlets).
In 1.6.0, the exception is as indicated in the original report:
java.lang.UnsupportedOperationException
at javax.faces.context.ExternalContext.setResponse(ExternalContext.java:856)
at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:436)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:114)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:150)
In 1.6.1 and 1.7 from the head, the exception is slightly different:
java.lang.ClassCastException: com.icesoft.faces.env.PortletEnvironmentRenderRequest
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:110)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:145)
at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:145)
The main problem is basically the same, though, and stems from the ViewHandler delegation model. All registered ViewHandlers are put into a non-deterministic chain (a linked list of sorts with no specified order). To make this work, ViewHandlers need to be sure which views they should handle and which they should delegate. By setting delegateNonIface = true, the ICEfaces D2DViewHandler delegates responsibility to Sun's default ViewHandler implementation which, in this case, it shouldn't as we need to do the actual processing in the ICEfaces framework.
So the quick fix is to set delegateNonIface = false. This brings up a separate issue in that the use of delegateNonIface cannot be used with Facelets in ICEfaces. This should be captured in a separate JIRA. If the submitter can verify that the setting the delegateNonIface = false works for their application, the case can be resolved.
---
Activity
Deryk Sinotte
created issue -
Ken Fyten
made changes -
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 1.7DR#3 [ 10112 ] | |
Assignee | Mircea Toma [ mircea.toma ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #15265 | Wed Nov 28 11:14:31 MST 2007 | mircea.toma | Always delegate if requests come in from a different servlet than MainServlet. |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandlerDelegating.java
MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandler.java |
Mircea Toma
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Affects | [Documentation (User Guide, Ref. Guide, etc.)] | |
Resolution | Fixed [ 1 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #15283 | Thu Nov 29 16:33:28 MST 2007 | mircea.toma | Refactor. |
Files Changed | ||||
DEL
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/xmlhttp/PersistentFacesCommonlet.java
MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/FacesContextFactoryImpl.java MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/MainServlet.java MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeExternalContext.java MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/servlet/ServletExternalContext.java MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/application/D2DViewHandler.java MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeFacesContext.java MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/portlet/PortletExternalContext.java |
Ken Fyten
made changes -
Fix Version/s | 1.7 [ 10080 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee | Mircea Toma [ mircea.toma ] |
I'd like to add that combination of standardRequestScope = true and delegateNonFaces = false produces the following warning:
WARN [D2DViewHandler] Failing over to default request path
May be this is the reason why navigation breaks down - any request ends up in the home page (1.7DR2, JBoss 4.2.1, Liferay 4.3.2, facelets)