ICEfaces
  1. ICEfaces
  2. ICE-1755

outputLink incorrectly encodes space as "+" in path

    Details

    • Assignee Priority:
      P2
    • Salesforce Case Reference:
    • Affects:
      Documentation (User Guide, Ref. Guide, etc.)
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Insert the link using

       <ice:outputText escape="false" value="#{bean.anchorText}" />
       
      where Bean.getAnchorText() returns literally
       
       <a href="http://localhost/webapp/file%20name.pdf" >PDF File</a>
       
      or implement a servlet that returns files requested with "+" in the path substituted for " ".

      Show
      Insert the link using  <ice:outputText escape="false" value="#{bean.anchorText}" />   where Bean.getAnchorText() returns literally    <a href=" http://localhost/webapp/file%20name.pdf " >PDF File</a>   or implement a servlet that returns files requested with "+" in the path substituted for " ".

      Description

      OutputLink is implemented as HttpServletResponse.encodeURL(url) as specified, so the "+" signs are being inserted by the standard Servlet URL encoding. It would be possible to use a different encoding method with ice:outputLink (indicated by a flag; this would be a new feature).

      <ice:outputLink percentEncode="true" value="http://host/some path/" />

      (percentEncode would force " " to be encoded as %20, over-riding HttpServletResponse.encodeURL(url))

      Note that using "+" in the path segment of a URL appears to be incorrect (http://www.ietf.org/rfc/rfc2396.txt does not indicate that "+" is reserved in the path component) so the JSF specified behavior is causing the problem.

        People

        • Assignee:
          Mircea Toma
          Reporter:
          Ted Goddard
        • Votes:
          0 Vote for this issue
          Watchers:
          4 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: