You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/08/06 18:30:58 UTC
svn commit: r983044 - in
/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago:
internal/lifecycle/RestoreViewExecutor.java
renderkit/TobagoResponseStateManager.java
Author: lofwyr
Date: Fri Aug 6 16:30:58 2010
New Revision: 983044
URL: http://svn.apache.org/viewvc?rev=983044&view=rev
Log:
TOBAGO-905: Wrong detection of post back, when existing request params and using GET request
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/lifecycle/RestoreViewExecutor.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/lifecycle/RestoreViewExecutor.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/lifecycle/RestoreViewExecutor.java?rev=983044&r1=983043&r2=983044&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/lifecycle/RestoreViewExecutor.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/lifecycle/RestoreViewExecutor.java Fri Aug 6 16:30:58 2010
@@ -17,6 +17,7 @@ package org.apache.myfaces.tobago.intern
* limitations under the License.
*/
+import org.apache.myfaces.tobago.renderkit.TobagoResponseStateManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.portlet.PortletUtils;
@@ -110,7 +111,7 @@ class RestoreViewExecutor implements Pha
facesContext.setViewRoot(viewRoot);
ComponentUtils.resetPage(facesContext);
- if (facesContext.getExternalContext().getRequestParameterMap().isEmpty()) {
+ if (isPostBack(facesContext)) {
// no POST or query parameters --> set render response flag
facesContext.renderResponse();
}
@@ -121,6 +122,11 @@ class RestoreViewExecutor implements Pha
return false;
}
+ private boolean isPostBack(FacesContext facesContext) {
+ Map requestParameterMap = facesContext.getExternalContext().getRequestParameterMap();
+ return requestParameterMap.containsKey(TobagoResponseStateManager.TREE_PARAM);
+ }
+
public PhaseId getPhase() {
return PhaseId.RESTORE_VIEW;
}
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java?rev=983044&r1=983043&r2=983044&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/TobagoResponseStateManager.java Fri Aug 6 16:30:58 2010
@@ -36,7 +36,7 @@ import java.io.IOException;
public class TobagoResponseStateManager extends ResponseStateManager {
private static final Logger LOG = LoggerFactory.getLogger(TobagoResponseStateManager.class);
- private static final String TREE_PARAM = "jsf_tree";
+ public static final String TREE_PARAM = "jsf_tree";
private static final String STATE_PARAM = "javax.faces.ViewState";
private static final String VIEWID_PARAM = "jsf_viewid";