incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r526647 - /incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
Date Mon, 09 Apr 2007 04:34:27 GMT
Author: awiner
Date: Sun Apr  8 21:34:22 2007
New Revision: 526647

URL: http://svn.apache.org/viewvc?view=rev&rev=526647
Log:
Fix double-slash URLs - broken by last checkin for ADFFACES-438.  Double-slash
URLs will no longer go through the ViewHandler at all, which isn't great


Modified:
    incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java

Modified: incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java?view=diff&rev=526647&r1=526646&r2=526647
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
Sun Apr  8 21:34:22 2007
@@ -71,18 +71,20 @@
    */
   static public String toResourceUri(FacesContext fc, Object o)
   {
-      if (o == null)
-        return null;
-
-      String uri = o.toString();
-
-      // Treat two slashes as server-relative
-      if (uri.startsWith("//"))
-      {
-          uri = uri.substring(1);
-      }
-
+    if (o == null)
+      return null;
+    
+    String uri = o.toString();
+    
+    // Treat two slashes as server-relative
+    if (uri.startsWith("//"))
+    {
+      return uri.substring(1);
+    }
+    else
+    {
       return fc.getApplication().getViewHandler().getResourceURL(fc, uri);
+    }
   }
 
   /**
@@ -90,18 +92,20 @@
    */
   static public String toActionUri(FacesContext fc, Object o)
   {
-      if (o == null)
-        return null;
-
-      String uri = o.toString();
-
-      // Treat two slashes as server-relative
-      if (uri.startsWith("//"))
-      {
-          uri = uri.substring(1);
-      }
-
+    if (o == null)
+      return null;
+    
+    String uri = o.toString();
+    
+    // Treat two slashes as server-relative
+    if (uri.startsWith("//"))
+    {
+      return uri.substring(1);
+    }
+    else
+    {
       return fc.getApplication().getViewHandler().getActionURL(fc, uri);
+    }
   }
 
 
@@ -110,7 +114,7 @@
    */
   static public String toUri(Object o)
   {
-      return toResourceUri(FacesContext.getCurrentInstance(),o);
+    return toResourceUri(FacesContext.getCurrentInstance(),o);
   }
 
 
@@ -564,7 +568,6 @@
   {
     if (value != null)
     {
-      
       value = context.getExternalContext().encodeActionURL(value.toString());
       context.getResponseWriter().writeURIAttribute(name, value, null);
     }



Mime
View raw message