Re: “Invalid number of parameters supplied for pattern” error

Splash Forums PrettyFaces Users "Invalid number of parameters supplied for pattern" error Re: “Invalid number of parameters supplied for pattern” error



Hello guys,

I use Prettyfaces with success. It generates links like /job/show?jobId=xx.

However, when I set up the pretty-config.xml to use path parameters, it stop to work. There are two different errors, depending on how configure <f:param> in view:

Situation 1: setting the attributes ‘name’ and ‘value’ of <f:param>

<pretty:link mappingId=”showJobId” id=”jobTitle” >

<f:param name=”jobId” value=”#{job.jobId}” />#{job.title}


In this case, prettyfaces generates the exception:

Invalid number of parameters supplied for pattern: /job/show/#{jobId}/, expected <1>, got <0>

And the page is blank. No link is generated.

Siatuação 2: Setting only the value attribute of <f:param>

<pretty:link mappingId=”showJobId” id=”jobTitle” >

<f:param value=”#{job.jobId}” />#{job.title}


In this case, the links are generated correctly (for example: /job/show/1). However, in the Becking bean, the jobId parameter always is null, i.e., request.getParmeter(“jobId”) is null.

Do you have any idea of the cause of this problem?

I use:

– JSF 1.2 + Facelets 3.2.0 prettyfaces

– The PrettyFilter Spring is located after the security filter.

– In the pretty-config.xml, use the following configuration:

<url-mapping id=”showJobId”>

<pattern value=”/job/show/#{jobId}/” />



– In view, I use the pretty link:

<pretty:link mappingId=”showJobId” id=”jobTitle” >

<f:param name=”jobId” value=”#{job.jobId}” />#{job.title}