You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mf...@apache.org on 2008/01/30 22:36:27 UTC

svn commit: r616912 - in /myfaces/portlet-bridge/trunk/impl/src/main: java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java resources/META-INF/faces-config.xml

Author: mfreedman
Date: Wed Jan 30 13:36:25 2008
New Revision: 616912

URL: http://svn.apache.org/viewvc?rev=616912&view=rev
Log:
Update with Patch 19b:
(re)Fixes JIRA-Portletbridge-19: Absolute URL processing was broken.
 Adds excludedAttributes statement to exclude com.sun.faces.* attributes so RI attrbiutes aren't preserved.

Modified:
    myfaces/portlet-bridge/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java
    myfaces/portlet-bridge/trunk/impl/src/main/resources/META-INF/faces-config.xml

Modified: myfaces/portlet-bridge/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java?rev=616912&r1=616911&r2=616912&view=diff
==============================================================================
--- myfaces/portlet-bridge/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java (original)
+++ myfaces/portlet-bridge/trunk/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java Wed Jan 30 13:36:25 2008
@@ -388,38 +388,41 @@
   public String encodeResourceURL(String s)
   {
 
-    if (!isExternalURL(s) && !s.startsWith("/"))
+    if (!isExternalURL(s))
     {
-      // must be a relative path -- convert it to contextPath relative
-      // construct our cwd (servletPath + pathInfo);
-      String pi = null;
-      String path = getRequestServletPath();
-      if (path == null)
+      if (!s.startsWith("/"))
       {
-        path = getRequestPathInfo();
-      }
-      else
-      {
-        pi = getRequestPathInfo();
-      }
+        // must be a relative path -- convert it to contextPath relative
+        // construct our cwd (servletPath + pathInfo);
+        String pi = null;
+        String path = getRequestServletPath();
+        if (path == null)
+        {
+          path = getRequestPathInfo();
+        }
+        else
+        {
+          pi = getRequestPathInfo();
+        }
 
-      if (pi != null)
-      {
-        path = path.concat(pi);
-      }
+        if (pi != null)
+        {
+          path = path.concat(pi);
+        }
 
-      // remove target
-      path = path.substring(0, path.lastIndexOf("/"));
-      s = URLUtils.convertFromRelative(path, s);
-    }
+        // remove target
+        path = path.substring(0, path.lastIndexOf("/"));
+        s = URLUtils.convertFromRelative(path, s);
+      }
     
-    // prepend the context path since portletResponse.encodeURL() requires a full path URI
-    // Don't need to check return from getRequestContextPath because there must
-    // always be a vlaue even if an empty string
-    String ctxPath = getRequestContextPath();
-    if (ctxPath.length() > 0 && !s.startsWith(ctxPath))
-    {
-      s = ctxPath + s;
+      // prepend the context path since portletResponse.encodeURL() requires a full path URI
+      // Don't need to check return from getRequestContextPath because there must
+      // always be a vlaue even if an empty string
+      String ctxPath = getRequestContextPath();
+      if (ctxPath.length() > 0 && !s.startsWith(ctxPath))
+      {
+        s = ctxPath + s;
+      }
     }
 
     String resourceURLStr = mPortletResponse.encodeURL(s);

Modified: myfaces/portlet-bridge/trunk/impl/src/main/resources/META-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/trunk/impl/src/main/resources/META-INF/faces-config.xml?rev=616912&r1=616911&r2=616912&view=diff
==============================================================================
--- myfaces/portlet-bridge/trunk/impl/src/main/resources/META-INF/faces-config.xml (original)
+++ myfaces/portlet-bridge/trunk/impl/src/main/resources/META-INF/faces-config.xml Wed Jan 30 13:36:25 2008
@@ -23,5 +23,10 @@
         <view-handler>org.apache.myfaces.portlet.faces.application.PortletViewHandlerImpl</view-handler>
         <state-manager>org.apache.myfaces.portlet.faces.application.PortletStateManagerImpl</state-manager>
         <el-resolver>org.apache.myfaces.portlet.faces.el.PortletELResolver</el-resolver>
+        <application-extension>
+          <bridge:excluded-attributes>
+            <bridge:excluded-attribute>com.sun.faces.*</bridge:excluded-attribute>
+          </bridge:excluded-attributes>       
+        </application-extension>
     </application>
 </faces-config>