myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1136985 - in /myfaces/core/branches/2.0.x: ./ impl/src/main/java/org/apache/myfaces/application/ impl/src/main/java/org/apache/myfaces/lifecycle/ impl/src/main/java/org/apache/myfaces/view/facelets/
Date Fri, 17 Jun 2011 19:11:54 GMT
Author: lu4242
Date: Fri Jun 17 19:11:54 2011
New Revision: 1136985

URL: http://svn.apache.org/viewvc?rev=1136985&view=rev
Log:
MYFACES-2395 Cant' run two JSF portlets on the same portal page

Modified:
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
    myfaces/core/branches/2.0.x/pom.xml

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java?rev=1136985&r1=1136984&r2=1136985&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java
(original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/application/StateManagerImpl.java
Fri Jun 17 19:11:54 2011
@@ -293,9 +293,9 @@ public class StateManagerImpl extends St
     {
         if (log.isLoggable(Level.FINEST)) log.finest("Entering writeState");
 
-        UIViewRoot uiViewRoot = facesContext.getViewRoot();
+        //UIViewRoot uiViewRoot = facesContext.getViewRoot();
         //save state in response (client)
-        RenderKit renderKit = getRenderKitFactory().getRenderKit(facesContext, uiViewRoot.getRenderKitId());
+        RenderKit renderKit = facesContext.getRenderKit();
         ResponseStateManager responseStateManager = renderKit.getResponseStateManager();
 
         responseStateManager.writeState(facesContext, state);

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java?rev=1136985&r1=1136984&r2=1136985&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java
(original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/lifecycle/DefaultRestoreViewSupport.java
Fri Jun 17 19:11:54 2011
@@ -26,6 +26,7 @@ import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
 import javax.faces.application.ProjectStage;
 import javax.faces.application.ViewHandler;
 import javax.faces.component.UIComponent;
@@ -35,12 +36,12 @@ import javax.faces.component.visit.Visit
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PostRestoreStateEvent;
+import javax.faces.render.RenderKitFactory;
 import javax.faces.render.ResponseStateManager;
 
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
 import org.apache.myfaces.shared_impl.application.FacesServletMapping;
 import org.apache.myfaces.shared_impl.application.InvalidViewIdException;
-import org.apache.myfaces.shared_impl.renderkit.RendererUtils;
 import org.apache.myfaces.shared_impl.util.Assert;
 
 /**
@@ -78,6 +79,8 @@ public class DefaultRestoreViewSupport i
 
     private Map<String, Boolean> _checkedViewIdMap = null;
     private Boolean _checkedViewIdCacheEnabled = null;
+    
+    private RenderKitFactory _renderKitFactory = null;
 
     public void processComponentBinding(FacesContext facesContext, UIComponent component)
     {
@@ -177,9 +180,18 @@ public class DefaultRestoreViewSupport i
     {
         ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
         String renderkitId = viewHandler.calculateRenderKitId(facesContext);
-        ResponseStateManager rsm = RendererUtils.getResponseStateManager(facesContext, renderkitId);
+        ResponseStateManager rsm = getRenderKitFactory().getRenderKit(facesContext, renderkitId).getResponseStateManager();
         return rsm.isPostback(facesContext);
     }
+    
+    protected RenderKitFactory getRenderKitFactory()
+    {
+        if (_renderKitFactory == null)
+        {
+            _renderKitFactory = (RenderKitFactory)FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+        }
+        return _renderKitFactory;
+    }
         
     private static class RestoreStateCallback implements VisitCallback
     {
@@ -558,4 +570,4 @@ public class DefaultRestoreViewSupport i
             return size() > maxCapacity;
         }
     }
-}
\ No newline at end of file
+}

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java?rev=1136985&r1=1136984&r2=1136985&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
(original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
Fri Jun 17 19:11:54 2011
@@ -40,6 +40,8 @@ import javax.faces.event.PostAddToViewEv
 import javax.faces.event.PreRemoveFromViewEvent;
 import javax.faces.event.SystemEvent;
 import javax.faces.event.SystemEventListener;
+import javax.faces.render.RenderKit;
+import javax.faces.render.RenderKitFactory;
 import javax.faces.render.ResponseStateManager;
 import javax.faces.view.StateManagementStrategy;
 import javax.faces.view.ViewDeclarationLanguage;
@@ -115,6 +117,8 @@ public class DefaultFaceletsStateManagem
     
     private ViewDeclarationLanguageFactory _vdlFactory;
     
+    private RenderKitFactory _renderKitFactory = null;
+    
     public DefaultFaceletsStateManagementStrategy ()
     {
         _vdlFactory = (ViewDeclarationLanguageFactory)FactoryFinder.getFactory(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY);
@@ -129,14 +133,13 @@ public class DefaultFaceletsStateManagem
         ResponseStateManager manager;
         Object state[];
         Map<String, Object> states;
-        
         UIViewRoot view = null;
-        
+ 
         // The value returned here is expected to be false (set by RestoreViewExecutor),
but
         //we don't know if some ViewHandler wrapper could change it, so it is better to save
the value.
         final boolean oldContextEventState = context.isProcessingEvents();
         // Get previous state from ResponseStateManager.
-        manager = RendererUtils.getResponseStateManager (context, renderKitId);
+        manager = getRenderKitFactory().getRenderKit(context, renderKitId).getResponseStateManager();
         
         //state = (Object[]) getStateCache().restoreSerializedView(context, viewId, manager.getState(context,
viewId));
         state = (Object[]) manager.getState(context, viewId);
@@ -793,6 +796,15 @@ public class DefaultFaceletsStateManagem
         }
     }
     
+    protected RenderKitFactory getRenderKitFactory()
+    {
+        if (_renderKitFactory == null)
+        {
+            _renderKitFactory = (RenderKitFactory)FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+        }
+        return _renderKitFactory;
+    }
+    
     /*
     private static class RestoreStateCallback implements VisitCallback
     {

Modified: myfaces/core/branches/2.0.x/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/pom.xml?rev=1136985&r1=1136984&r2=1136985&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/pom.xml (original)
+++ myfaces/core/branches/2.0.x/pom.xml Fri Jun 17 19:11:54 2011
@@ -56,7 +56,7 @@
 
     <properties>
         <!-- MyFaces shared-impl version to use -->
-        <myfaces-shared.version>4.0.7</myfaces-shared.version>
+        <myfaces-shared.version>4.0.8-SNAPSHOT</myfaces-shared.version>
     </properties>
 
     <build>



Mime
View raw message