[seam-commits] Seam SVN: r7537 - branches/Seam_2_0/src/main/org/jboss/seam/navigation.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Mar 11 18:33:02 EDT 2008


Author: norman.richards at jboss.com
Date: 2008-03-11 18:33:02 -0400 (Tue, 11 Mar 2008)
New Revision: 7537

Modified:
   branches/Seam_2_0/src/main/org/jboss/seam/navigation/Pages.java
Log:
JBSEAM-2698

Modified: branches/Seam_2_0/src/main/org/jboss/seam/navigation/Pages.java
===================================================================
--- branches/Seam_2_0/src/main/org/jboss/seam/navigation/Pages.java	2008-03-11 22:25:31 UTC (rev 7536)
+++ branches/Seam_2_0/src/main/org/jboss/seam/navigation/Pages.java	2008-03-11 22:33:02 UTC (rev 7537)
@@ -169,24 +169,29 @@
     * Create a new Page object for a JSF view id,
     * by searching for a viewId.page.xml file.
     */
-   private Page createPage(String viewId)
-   {
-      String resourceName = replaceExtension(viewId, ".page.xml");
-      InputStream stream = resourceName==null ? 
-            null : ResourceLoader.instance().getResourceAsStream( resourceName.substring(1) );
-      if ( stream==null ) 
-      {
-         Page result = new Page(viewId);
-         pagesByViewId.put(viewId, result);
-         return result;
-      }
-      else
-      {
-         parse(stream, viewId);
-         return getCachedPage(viewId);
-      }
-   }
+    private Page createPage(String viewId)
+    {
+        String resourceName = replaceExtension(viewId, ".page.xml");
+        InputStream stream = null;
+      
+        if (resourceName!=null) {
+            stream = ResourceLoader.instance().getResourceAsStream(resourceName.substring(1));
+
+            if (stream == null) {
+                stream = ResourceLoader.instance().getResourceAsStream(resourceName);
+            }
+        }
    
+        if (stream==null) {
+            Page result = new Page(viewId);
+            pagesByViewId.put(viewId, result);
+            return result;
+        } else {
+            parse(stream, viewId);
+            return getCachedPage(viewId);
+        }
+    }
+
    private Page getCachedPage(String viewId)
    {
       Page result = pagesByViewId.get(viewId);




More information about the seam-commits mailing list