'$' symbol in mapped URL path

Splash Forums PrettyFaces Users '$' symbol in mapped URL path

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

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #17904

    0swald
    Participant

    Hi all.

    The same mapping as in my previous post:

    @URLMapping(id="test", pattern="/test/#{bean.subject}/", viewId="/faces/pages/test.xhtml")

    Works fine unless user manually puts $ (URL safe character) in url path:

    http://localhost:9090/myapp/test/a$/ produces

    java.lang.StringIndexOutOfBoundsException: String index out of range: 2
    java.lang.String.charAt(String.java:686)
    java.util.regex.Matcher.appendReplacement(Matcher.java:711)
    com.ocpsoft.pretty.faces.url.URLPatternParser.getMappedURL(URLPatternParser.java:261)

    http://localhost:9090/myapp/test/a$b/ produces

    java.lang.IllegalArgumentException: Illegal group reference
    java.util.regex.Matcher.appendReplacement(Matcher.java:713)
    com.ocpsoft.pretty.faces.url.URLPatternParser.getMappedURL(URLPatternParser.java:261)

    Looks like $-symbol is not escaped inside URLPatternParser.

    Happens both in stable version and latest snapshot.

    #20859

    Yes, I can confirm this. This is definitively a bug. I think its caused by $ having a special meaning in string replacements done with regular expressions.

    Could you open a ticket for this?

    #20860

    Forget about the ticket. I think I found the bug. Could you try the new snapshots that will be available in about 10 minutes?

    Thanks again for reporting you problems. We are always happy to get any kind of feedback! :)

    #20861

    0swald
    Participant
    #20862

    0swald
    Participant

    oops, too late, ticket opened :) I have an hour or so, will check new snapshot and report.

    #20863

    0swald
    Participant

    Christian, issue solved in latest prettyfaces-jsf2-3.2.1-20110404.093415-17, thanks!

    #20864

    You are welcome! Let us know if you have any further problems! :)

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

You must be logged in to reply to this topic.

Comments are closed.