myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jak...@apache.org
Subject svn commit: r920889 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
Date Tue, 09 Mar 2010 14:22:36 GMT
Author: jakobk
Date: Tue Mar  9 14:22:36 2010
New Revision: 920889

URL: http://svn.apache.org/viewvc?rev=920889&view=rev
Log:
MYFACES-2563 Trinidad 1.2.x generates on POSTBACK a NullPointerException on MyFAces2

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java?rev=920889&r1=920888&r2=920889&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ViewHandlerImpl.java
Tue Mar  9 14:22:36 2010
@@ -282,7 +282,7 @@ public class ViewHandlerImpl extends Vie
         Map<String, List<String>> viewParameters;
         UIViewRoot viewRoot = context.getViewRoot();
         String currentViewId = viewRoot.getViewId();
-        Collection<UIViewParameter> toViewParams;
+        Collection<UIViewParameter> toViewParams = null;
         Collection<UIViewParameter> currentViewParams = ViewMetadata.getViewParameters(viewRoot);
 
         if (currentViewId.equals(viewId))
@@ -294,11 +294,15 @@ public class ViewHandlerImpl extends Vie
             String calculatedViewId = getViewHandlerSupport().calculateViewId(context, viewId);
           
             ViewDeclarationLanguage vdl = getViewDeclarationLanguage(context,calculatedViewId);
             ViewMetadata viewMetadata = vdl.getViewMetadata(context, viewId);
-            UIViewRoot viewFromMetaData = viewMetadata.createMetadataView(context);
-            toViewParams = ViewMetadata.getViewParameters(viewFromMetaData);
+            // getViewMetadata() returns null on JSP
+            if (viewMetadata != null)
+            {
+                UIViewRoot viewFromMetaData = viewMetadata.createMetadataView(context);
+                toViewParams = ViewMetadata.getViewParameters(viewFromMetaData);
+            }
         }
 
-        if (toViewParams.isEmpty())
+        if (toViewParams == null || toViewParams.isEmpty())
         {
             return parametersFromArg;
         }



Mime
View raw message