chkal/pf-issue-test — Issue #96: unhandled '$' symbol in mapped URL path
Author: chkal
Created: 2012-03-06 07:34:08+00:00
State: open

Originally filed by **Andrey.S...@gmail.com** on 2011-04-04T09:32:58

Google Code issue: http://code.google.com/p/prettyfaces/issues/detail?id=98

Steps to reproduce:
1. Create managed bean pretty-mapped as follows
@URLMapping(id="test", pattern="/test/#{bean.subject}/", viewId="/faces/pages/test.xhtml")
2. Deploy and browse to url /contextpath/test/a$/ or /contextpath/test/a$b/

Depending on position of $-character inside #{bean.subject} url part two exceptions are raised:

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)

or

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

Exceptions are raising both on stable 3.2.0 and 3.2.1-20110402.070324-16 snapshot.

Server: Tomcat 7.0.11 with mojarra 2.0.4.