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 2011/06/23 19:59:46 UTC

svn commit: r1139020 - /myfaces/portlet-bridge/core/branches/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java

Author: mfreedman
Date: Thu Jun 23 17:59:45 2011
New Revision: 1139020

URL: http://svn.apache.org/viewvc?rev=1139020&view=rev
Log:
PORTLETBRIDGE-215: EncodeResourceURL improperly recognizes non context path encoded urls as being internal.

Modified:
    myfaces/portlet-bridge/core/branches/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java

Modified: myfaces/portlet-bridge/core/branches/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/portlet-bridge/core/branches/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java?rev=1139020&r1=1139019&r2=1139020&view=diff
==============================================================================
--- myfaces/portlet-bridge/core/branches/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java (original)
+++ myfaces/portlet-bridge/core/branches/trunk_2.0.x/impl/src/main/java/org/apache/myfaces/portlet/faces/context/PortletExternalContextImpl.java Thu Jun 23 17:59:45 2011
@@ -340,7 +340,7 @@ public class PortletExternalContextImpl
     {
       return url;
     }  
-    else if (isDirectLink(url))
+    else if (isExternalURL(url) || isDirectLink(url))
     {
       // its not an absolute URL (or would have been handled in previous if) convert it into one.
       return getAbsoluteUrlFromPath(url);
@@ -606,12 +606,17 @@ public class PortletExternalContextImpl
       getRequestMap().put(BridgeImpl.REDIRECT_VIEWPARAMS, params);
       FacesContext.getCurrentInstance().responseComplete();
     }
-    else if ((url.startsWith("#") || isExternalURL(url) || isDirectLink(url)))
+    else if (url.startsWith("#") || isAbsoluteURL(url))
     {
       ((ActionResponse) getResponse()).sendRedirect(url);
       FacesContext.getCurrentInstance().responseComplete();
 
     }
+    else if (isExternalURL(url) || isDirectLink(url))
+    {
+      ((ActionResponse) getResponse()).sendRedirect(getAbsoluteUrlFromPath(url));
+      FacesContext.getCurrentInstance().responseComplete();
+    }
     else
     {
       // is it an unencoded Faces URL -- process it.
@@ -2192,7 +2197,7 @@ public class PortletExternalContextImpl
 
   private boolean isExternalURL(String url)
   {
-    if (!isAbsoluteURL(url))
+    if (!isAbsoluteURL(url) && !url.startsWith("/"))
     {
       return false;
     }