portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shins...@apache.org
Subject svn commit: r453273 - /portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
Date Thu, 05 Oct 2006 15:44:06 GMT
Author: shinsuke
Date: Thu Oct  5 08:44:06 2006
New Revision: 453273

URL: http://svn.apache.org/viewvc?view=rev&rev=453273
Log:
fixed http://issues.apache.org/jira/browse/JS2-591

Modified:
    portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java

Modified: portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java?view=diff&rev=453273&r1=453272&r2=453273
==============================================================================
--- portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
(original)
+++ portals/jetspeed-2/trunk/layout-portlets/src/java/org/apache/jetspeed/portlets/layout/MultiColumnPortlet.java
Thu Oct  5 08:44:06 2006
@@ -16,6 +16,8 @@
 package org.apache.jetspeed.portlets.layout;
 
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Iterator;
@@ -263,11 +265,12 @@
                             String path = parent.getPath();
                             if (path.endsWith(Folder.PATH_SEPARATOR))
                             {
-                                path = path + jsPageName;
+                                path = path + getEscapedPageName(jsPageName);
                             }
                             else
                             {
-                                path = path + Folder.PATH_SEPARATOR + jsPageName;
+                                path = path + Folder.PATH_SEPARATOR
+                                        + getEscapedPageName(jsPageName);
                             }
                             Page page = pageManager.newPage(path);
                             if ( layout == null || layout.length() == 0 )
@@ -491,5 +494,18 @@
             }
         }
         return -1;
+    }
+
+    protected String getEscapedPageName(String pageName)
+    {
+        try
+        {
+            return URLEncoder.encode(pageName, "UTF-8").replace("%", "_");
+        }
+        catch (UnsupportedEncodingException e)
+        {
+            log.warn("Unsupported Encoding Exception.", e);
+            return pageName;
+        }
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message