Exception with Curly braces in URL parameters

Splash Forums PrettyFaces Users Exception with Curly braces in URL parameters

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Kaltepoth 3 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #27389


    With Pretty Faces 3.0.1, curly braces in parameters used to work. However with 3.3.3, I get the following exception:

    java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 17: http://localhost/{default}
    at com.ocpsoft.pretty.faces.url.URL.decodeSegment(URL.java:161)
    at com.ocpsoft.pretty.faces.url.URL.getDecodedSegments(URL.java:99)
    at com.ocpsoft.pretty.faces.url.URL.decode(URL.java:170)
    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:130)

    I see that com.ocpsoft.pretty.faces.url.URL::decodeSegment in Pretty Faces 3.3.3 replaces special characters such as [, ], <, > but doesn’t replace { or }. I wonder if this is a bug?



    PrettyFaces 3.3.3 is VERY old. PrettyFaces is now part of Rewrite. You should check if updating to Rewrite fixes your problem.



    Thanks, yes, that has been on our list of things to do for a while now. Since it is not a trivial task on our side to migrate, would it be possible to have a fix for this in a maintenance release?

    The fix is pretty simple:

    prettyfaces$ git diff
    diff –git a/core/src/main/java/com/ocpsoft/pretty/faces/url/URL.java b/core/src/
    index 15bac70..33f5390 100644
    — a/core/src/main/java/com/ocpsoft/pretty/faces/url/URL.java
    +++ b/core/src/main/java/com/ocpsoft/pretty/faces/url/URL.java
    @@ -161,6 +161,8 @@ public class URL
    .replace(“<“, “%3C”)
    .replace(“>”, “%3E”)
    .replace(“|”, “%7C”)
    + .replace(“{“, “%7B”)
    + .replace(“}”, “%7D”)


    Sorry, but we cannot do maintenance release of the 3.3.x branch anymore as we don’t have the required permissions to push releases for this groupId to the Maven central repository. 🙁

    So if you really want to stay with PrettyFaces 3.3.x, you will have to do an internal bugfix release yourself. It’s all open source, so this should be easy to do.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Comments are closed.