Permalink
Browse files

https://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-790

Fix failing view state on cross form PPR.
Improved/clarified JSF/JS API as to namespaced parameters.
  • Loading branch information...
BalusC committed Jun 20, 2016
1 parent bbf7f0e commit ff26c4dccafd50d22757ce8562230e31f9768033
Showing with 892 additions and 426 deletions.
  1. +4 −3 jsf-api/src/main/java/javax/faces/application/ViewHandler.java
  2. +9 −2 jsf-api/src/main/java/javax/faces/context/PartialResponseWriter.java
  3. +15 −1 jsf-api/src/main/java/javax/faces/context/PartialViewContext.java
  4. +155 −126 jsf-api/src/main/resources/jsf.js
  5. +1 −4 jsf-ri/src/main/java/com/sun/faces/config/WebConfiguration.java
  6. +23 −47 jsf-ri/src/main/java/com/sun/faces/context/RequestParameterMap.java
  7. +16 −37 jsf-ri/src/main/java/com/sun/faces/renderkit/ClientSideStateHelper.java
  8. +13 −17 jsf-ri/src/main/java/com/sun/faces/renderkit/RenderKitUtils.java
  9. +28 −45 jsf-ri/src/main/java/com/sun/faces/renderkit/ServerSideStateHelper.java
  10. +20 −51 jsf-ri/src/main/java/com/sun/faces/renderkit/StateHelper.java
  11. +4 −35 jsf-ri/src/main/java/com/sun/faces/renderkit/html_basic/AjaxBehaviorRenderer.java
  12. +4 −19 jsf-ri/src/main/java/com/sun/faces/renderkit/html_basic/FormRenderer.java
  13. +6 −21 jsf-ri/src/main/java/com/sun/faces/renderkit/html_basic/OutputLinkRenderer.java
  14. +40 −16 jsf-ri/src/main/java/com/sun/faces/util/Util.java
  15. +67 −0 test/javaee8/ajax/src/main/webapp/spec790.xhtml
  16. +104 −0 test/javaee8/ajax/src/test/java/com/sun/faces/test/javaee8/ajax/Spec790IT.java
  17. +71 −0 test/javaee8/namespacedView/pom.xml
  18. +47 −0 ...avaee8/namespacedView/src/main/java/com/sun/faces/test/javaee8/namespacedView/NamespacedView.java
  19. +7 −0 test/javaee8/namespacedView/src/main/webapp/WEB-INF/beans.xml
  20. +12 −0 test/javaee8/namespacedView/src/main/webapp/WEB-INF/faces-config.xml
  21. +69 −0 test/javaee8/namespacedView/src/main/webapp/WEB-INF/web.xml
  22. +67 −0 test/javaee8/namespacedView/src/main/webapp/spec790.xhtml
  23. +107 −0 test/javaee8/namespacedView/src/test/java/com/sun/faces/test/javaee8/namespacedView/Spec790IT.java
  24. +1 −0 test/javaee8/pom.xml
  25. +2 −2 ...space/src/main/java/com/sun/faces/test/servlet30/ajaxnamespace/NamespacedRequestParameterMap.java
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2014 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997-2016 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -737,8 +737,9 @@ public abstract void renderView(FacesContext context, UIViewRoot viewToRender)
* <code>Ajax</code> requests, the state is obtained by calling
* {@link StateManager#getViewState}
* and then written into the <code>Ajax</code> response during final
* encoding
* ({@link javax.faces.component.UIViewRoot#encodeEnd}.
* encoding <span class="changed_modified_2_3">
* ({@link javax.faces.context.PartialViewContext#processPartial(javax.faces.event.PhaseId)})
* </span>.
* </p>
*
* @param context {@link FacesContext} for the current request
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997-2016 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -42,6 +42,9 @@
import java.io.IOException;
import java.util.Map;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIViewRoot;
import javax.faces.render.ResponseStateManager;
/**
@@ -113,6 +116,10 @@ public ResponseWriter getWrapped() {
/**
* <p class="changed_added_2_0">Write the start of a partial response.</p>
* <p class="changed_added_2_3">If {@link UIViewRoot} is an instance of
* {@link NamingContainer}, then write
* {@link UIViewRoot#getContainerClientId(FacesContext)} as value of the
* <code>id</code> attribute of the root element.</p>
*
* @throws IOException if an input/output error occurs
* @since 2.0
@@ -127,7 +134,7 @@ public void startDocument() throws IOException {
writer.writePreamble("<?xml version='1.0' encoding='" + encoding + "'?>\n");
writer.startElement("partial-response", null);
FacesContext ctx = FacesContext.getCurrentInstance();
if (null != ctx && null != ctx.getViewRoot()) {
if (null != ctx && ctx.getViewRoot() instanceof NamingContainer) {
String id = ctx.getViewRoot().getContainerClientId(ctx);
writer.writeAttribute("id", id, "id");
}
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 1997-2010 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997-2016 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
@@ -43,6 +43,9 @@
import java.util.Collection;
import java.util.List;
import javax.faces.application.StateManager;
import javax.faces.component.UINamingContainer;
import javax.faces.component.UIViewRoot;
import javax.faces.event.PhaseId;
/**
@@ -314,6 +317,17 @@ public boolean isResetValues() {
* <code>Collection</code> returned from {@link #getExecuteIds}
* and {@link #getRenderIds} will be processed.</p>
*
* <p class="changed_added_2_3">When the indicated <code>phaseId</code>
* equals {@link PhaseId#RENDER_RESPONSE}, then obtain the state by calling
* {@link StateManager#getViewState} and write out it as an update element
* with an identifier of
* <code>&lt;VIEW_ROOT_CONTAINER_CLIENT_ID&gt;&lt;SEP&gt;javax.faces.ViewState</code>
* where <code>&lt;VIEW_ROOT_CONTAINER_CLIENT_ID&gt;</code> is the return
* from {@link UIViewRoot#getContainerClientId(FacesContext)} on the view
* from whence this state originated, and <code>&lt;SEP&gt;</code> is the
* currently configured
* {@link UINamingContainer#getSeparatorChar(FacesContext)}.</p>
*
* @param phaseId the {@link javax.faces.event.PhaseId} that indicates
* the lifecycle phase the components will be processed in.
*/
Oops, something went wrong.

0 comments on commit ff26c4d

Please sign in to comment.