-
Notifications
You must be signed in to change notification settings - Fork 19
Modify the requirements of the jsf.ajax.response JavaScript documentation to enable portlet compatibility #1421
Comments
Reported by ngriffin7a |
Issue-Links: |
Was assigned to ngriffin7a |
@BalusC said: In other words, when render="@ALL" is used, it will already not anymore write out . It's only left unspecified in the spec. All in all, when also considering issue 790, I think it makes sense to propose the following change to be as transparent as possible (i.e. do not mention Portlet specifics and do not change JavaScript):
This way, we can also remove the Util.isPortletRequest() check from the current implementation. The javax.faces.ViewBody is nowhere considered in JSF API nor in Mojarra impl, it's only mentioned in JS API. It's internally treated exactly the same way as javax.faces.ViewRoot. I guess it's a leftover, so we can ignore it for now. Perhaps it should better be removed from JS API, but that's a different issue. |
ngriffin7a said:
Thanks for pointing out the code in com.sun.faces.context.PartialViewContextImpl – This functionality was introduced into Mojarra 2.2 by Manfred via commit e25abcae and 0e42795e. I did some research and the reason why ResponseWriterBridgeImpl.java still contains a workaround is because the MyFaces PartialViewContextImpl. processRenderAll(UIViewRoot,PartialResponseWriter) method does not yet implement the requirements outlined in section 2.2.6.1 of the Spec. I just created MYFACES-4053 and will try to contribute a fix soon. I really like your idea of using language like "if UIViewRoot is an instance of UINamingContainer" rather than "if this is a portlet request" and would recommend that section 2.2.6.1 of the Spec be updated. Finally, I agree with your assessment regarding javax.faces.ViewBody. After studying the JavaScript documentation more today, I also noticed javax.faces.ViewHead. I think that the Bridge Spec can simply state that bridge implementations should ignore these features since they are inherently incompatible with portlet environments. |
stiemannkj1 said: Here's the proposed changes to spec section 2.2.6.1 (removed text appears as strikethrough, added text is bold):
Here's the proposed implementation changes: stiemannkj1/jsf-spec-mojarra@611f5f0. I haven't been able to test the changes yet though. @Neil Griffin, should this issue be closed, and a new issue or email be opened about changing the spec? |
ngriffin7a said: |
stiemannkj1 said: Since the spec has been changed according to my comments, I've created a PR to vsingleton to change the implementation to be consistent with the spec: vsingleton/mojarra#15 I've tested these changes against the following modules (and they passed):
|
vsingleton said: https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-1421 modify PartialViewContext renderAll requirements to remove references to portlets modified: jsf-ri/src/main/java/com/sun/faces/context/PartialViewContextImpl.java |
Marked as fixed on Thursday, January 12th 2017, 4:10:58 pm |
This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-1421 |
The jsf.ajax.response JavaScript documentation contains requirements that are not compatible with portlet environments.
Portlet Incompatibility #1
Portlet Incompatibility #2
These requirements assume that the RENDER_RESPONSE phase of the JSF lifecycle was responsible for generating the entire HTML document including the following tags:
The requirements further assume that the renderer associated with the h:body component tag renders the starting tag and end tag, and that the <f:view> (UIViewRoot) corresponds to the body section of the document.
In a portlet environment, the JSF Portlet Bridge ensures that object returned by FacesContext.getCurrentInstance().getViewRoot() to be an instance of javax.portlet.faces.component.PortletNamingContainerUIViewRoot. Since it extends javax.faces.component.NamingContainer, the UIViewRoot becomes "namespaced" with the portlet namespace.
The JSF Portlet Bridge also overrides the renderer associated with the h:body component and renders a
The JSF Portlet Bridge also overrides the renderer associated with the h:head component so that it can inform the portlet container of required JSF resources. The renderer does not render a ... section in a portlet environment.
For example, given the following JSF view:
On Apache Pluto the portlet div section might look something like this:
The requirements need to be updated so that they enable portlet compatibility by replacing the
Environment
Portlets
Affected Versions
[2.2]
The text was updated successfully, but these errors were encountered: