Reply To: Match anything in pattern using regexp

Splash Forums PrettyFaces Users Match anything in pattern using regexp Reply To: Match anything in pattern using regexp

#24621

Yeah, this is a problem people often run into. I typically recommend to either add some kind of prefix to the URL (essential you suggestion 3.) or to restrict the regular expressions of the path parameters. In your case you could for example restrict the first parameter to a string containing characters but no periods. Something like this:

<pattern value="/#{ /[a-z]+/ something }/#{ /[0-9]+/ entityId }"/>

See this part of the documentation for details:

http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/Configuration.html#config.pathparams.regex

Our new project Rewrite, which is the successor of PrettyFaces, allows to handle such cases more easy. See Lincoln’s post here:

http://ocpsoft.org/support/topic/rewrite-conflicts-with-imageservlet/#post-24593

If you want to learn more about how to migrate from PrettyFaces to Rewrite (and keeping your pretty-config.xml), have a look at the migration guide I wrote:

http://ocpsoft.org/rewrite/docs/migration/prettyfaces3

Hope this helps. 🙂

Christian