Re: How do I combine Path params with Query params?

Splash Forums PrettyFaces Users How do I combine Path params with Query params? Re: How do I combine Path params with Query params?

#20497

Regarding your regular expression problem, try:

<pattern value="report/#{reportName}/#{ /\d{8}/ reportDate}" />

Meaning you will have to write /\d{8}/ instead of /d{8}/ (escape the ”). See the current snapshot of the documentation for details:

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

Regarding default path parameter values. That is currently not possible. And I’m note sure if this would make sense. Path parameters are required by their nature. If you want optional values in the URL, you should really use query parameters.

But if you still want to use path parameters for the report date, you will have to add a second mapping for that. Perhaps you could remove the bean from session scope? Is it really required to hold such a bean in the session scope? Otherwise you could use PrettyContext in your action method to get the “current mapping id” and manually set your report date to null if you detect the mapping without a report date.