You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2010/03/18 23:24:31 UTC
svn commit: r925025 - in
/myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces:
application/PortletViewHandlerImpl.java context/PortletFacesContextImpl.java
Author: mfreedman
Date: Thu Mar 18 22:24:31 2010
New Revision: 925025
URL: http://svn.apache.org/viewvc?rev=925025&view=rev
Log:
PORTLETBRIDGE-129: FacesContext.release() ConcurrentModificationException
PORTLETBRIDGE-131: Render redirect caused by JSF EL should return without flush/commit
Modified:
myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java
myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextImpl.java
Modified: myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java?rev=925025&r1=925024&r2=925025&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java (original)
+++ myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/application/PortletViewHandlerImpl.java Thu Mar 18 22:24:31 2010
@@ -351,6 +351,14 @@ public class PortletViewHandlerImpl exte
doRenderView(context, viewToRender);
newWriter.endDocument();
+
+ // Check again to see if the processing of the Faces view triggered a redirect
+ redirectParams = (QueryString) context.getExternalContext()
+ .getRequestMap().get(BridgeImpl.REDIRECT_VIEWPARAMS);
+ if ((redirectParams != null))
+ {
+ return;
+ }
// replace markers in the body content and write it to response.
Modified: myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextImpl.java?rev=925025&r1=925024&r2=925025&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextImpl.java (original)
+++ myfaces/portlet-bridge/core/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletFacesContextImpl.java Thu Mar 18 22:24:31 2010
@@ -334,16 +334,24 @@ public class PortletFacesContextImpl ext
// This is done because some (local) portals run/render all portlets in the same request
PortletRequest request = (PortletRequest)mExternalContext.getRequest();
List<String> preExistingAttrs = (List<String>) request.getAttribute(BridgeImpl.PREEXISTING_ATTRIBUTE_NAMES);
+ ArrayList<String> removeList = (ArrayList<String>) new ArrayList(preExistingAttrs.size());
Enumeration<String> e = request.getAttributeNames();
while (e.hasMoreElements())
{
String name = e.nextElement();
if (!preExistingAttrs.contains(name))
{
- request.removeAttribute(name);
+ // Postpone the remove until after the iteration as it causes a ConcurrentModificationException on some appServers (WebSphere)
+ removeList.add(name);
}
}
+ // Postpone the remove until after the iteration as it causes a ConcurrentModificationException on some appServers (WebSphere)
+ for(Iterator<String> iter = removeList.iterator(); iter.hasNext();)
+ {
+ request.removeAttribute(iter.next());
+ }
+
if (mExternalContext != null && mExternalContext instanceof PortletExternalContextImpl)
{