incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject svn commit: r525645 - in /incubator/adffaces/trunk/trinidad: trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MViewHandler.java
Date Wed, 04 Apr 2007 23:59:49 GMT
Author: mmarinschek
Date: Wed Apr  4 16:59:48 2007
New Revision: 525645

URL: http://svn.apache.org/viewvc?view=rev&rev=525645
Log:
full fix for: https://issues.apache.org/jira/browse/ADFFACES-438 - viewHandler.getResourceUrl()
not used

Modified:
    incubator/adffaces/trunk/trinidad/trinidad-api/src/main/java/org/apache/myfaces/trinidad/render/CoreRenderer.java
    incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MViewHandler.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=525645&r1=525644&r2=525645
==============================================================================
--- 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
Wed Apr  4 16:59:48 2007
@@ -66,6 +66,9 @@
     return o.toString();
   }
 
+  /**
+   * Coerces an object into a resource URI, calling the view-handler.
+   */
   static public String toResourceUri(FacesContext fc, Object o)
   {
       if (o == null)
@@ -82,6 +85,9 @@
       return fc.getApplication().getViewHandler().getResourceURL(fc, uri);
   }
 
+  /**
+   * Coerces an object into an action URI, calling the view-handler.
+   */
   static public String toActionUri(FacesContext fc, Object o)
   {
       if (o == null)
@@ -100,31 +106,11 @@
 
 
   /**
-   * Coerces an object into a URI, accounting for JSF rules
-   * with initial slashes.
+   * Coerces an object into a resource URI, calling the view-handler.
    */
-
   static public String toUri(Object o)
   {
-    if (o == null)
-      return null;
-    
-    String uri = o.toString();
-    if (uri.startsWith("/"))
-    {
-      // Treat two slashes as server-relative
-      if (uri.startsWith("//"))
-      {
-        uri = uri.substring(1);
-      }
-      else
-      {
-        FacesContext fContext = FacesContext.getCurrentInstance();
-        uri = fContext.getExternalContext().getRequestContextPath() + uri;
-      }
-    }
-
-    return uri;
+      return toResourceUri(FacesContext.getCurrentInstance(),o);
   }
 
 

Modified: incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MViewHandler.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MViewHandler.java?view=diff&rev=525645&r1=525644&r2=525645
==============================================================================
--- incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MViewHandler.java
(original)
+++ incubator/adffaces/trunk/trinidad/trinidad-impl/src/test/java/org/apache/myfaces/trinidadinternal/renderkit/MViewHandler.java
Wed Apr  4 16:59:48 2007
@@ -51,13 +51,19 @@
   @Override
   public String getActionURL(FacesContext context, String viewId)
   {
-    return "/test-context-path" + viewId;
+    if(viewId == null)
+        return null;
+
+    if(viewId.charAt(0)=='/')
+        return "/test-context-path" + viewId;
+    else
+        return viewId;
   }
 
   @Override
   public String getResourceURL(FacesContext context, String viewId)
   {
-    return "/test-context-path" + viewId;
+    return getActionURL(context, viewId);
   }
 
   @Override



Mime
View raw message