myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mstar...@apache.org
Subject svn commit: r1438682 - /myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java
Date Fri, 25 Jan 2013 20:14:14 GMT
Author: mstarets
Date: Fri Jan 25 20:14:14 2013
New Revision: 1438682

URL: http://svn.apache.org/viewvc?rev=1438682&view=rev
Log:
Cache the boolean flag for facelets on the VDL wrapper

Modified:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java?rev=1438682&r1=1438681&r2=1438682&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java
(original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewDeclarationLanguageFactoryImpl.java
Fri Jan 25 20:14:14 2013
@@ -331,13 +331,24 @@ public class ViewDeclarationLanguageFact
     public void renderView(FacesContext context, UIViewRoot view) throws IOException
     {
       // TRINIDAD-2347 - make sure that the session is 'touched' before rendering a page
with Facelets
-      if (!context.isPostback() && FACELETS_VIEW_DECLARATION_LANGUAGE_ID.equals(getId()))
+      if (!context.isPostback() && _isFacelets())
       {
         context.getExternalContext().getSession(true);
       }
       super.renderView(context, view);
     }
+    
+    private boolean _isFacelets()
+    {
+      if (_facelets == null)
+      {
+        _facelets = FACELETS_VIEW_DECLARATION_LANGUAGE_ID.equals(getId());
+      }
+      return _facelets;
+    }
 
     private final ViewDeclarationLanguage _wrapped;
+    
+    private Boolean _facelets = null;
   }
 }



Mime
View raw message