[jira] [Created] (PLUTO-745) Context root with "/" in the middle leads to an error

"Peter Meyer (JIRA)" <[email protected]> Wed, 6 Feb 2019 09:40:00 +0000 (UTC)
Newsgroups gmane.comp.jakarta.pluto.devel
Message-ID <[email protected]>
Peter Meyer created PLUTO-745:
---------------------------------

             Summary: Context root with "/" in the middle leads to an error
                 Key: PLUTO-745
                 URL: https://issues.apache.org/jira/browse/PLUTO-745
             Project: Pluto
          Issue Type: Bug
          Components: portal driver
    Affects Versions: 3.0.1
            Reporter: Peter Meyer
            Assignee: Scott Nicklous


A portlet application with context root /online/ReferenzPortlets leads to an error when submitting a form - the url of the form cannot be executed - HTTP 400.

This is due to the character which replaces the middle "/" in the portlet id part of the URL.

To my analyses the problem arises in the class org.apache.pluto.driver.url.impl.PortalURLParserImpl in the method "toString" at line 454.

for (String pid : portalURL.getPortletIds()) {
 pids.add(pid);
 buffer.append(TOKEN_DELIM).append(PREFIX).append(PORTLET_ID);
 try {
 buffer.append(URLEncoder.encode(pid, "UTF-8"));
 } catch(Exception e) {
 LOG.warn("Could not encode pid=" + pid);
 }
 buffer.append(DELIM).append(String.valueOf(pids.indexOf(pid)));
 }

I suggest to replace the expression URLEncoder.encode(pid, "UTF-8") with urlEncode(pid). In the decode part there is already the use of the urlDecode method on the pid part of the URL.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)