Re: Page Actions with Annotations does not work with @URLMappingS

Splash Forums PrettyFaces Users Page Actions with Annotations does not work with @URLMappingS Re: Page Actions with Annotations does not work with @URLMappingS

#23415

This exception is basically telling you that PrettyFaces was trying to build an URL for the mapping itemBean2 for rendering it to the page and the current value of #{bean.itemId} was null, which cannot work. Of cause initializing the value with an empty String will work and result in an URL like /shop// but I don’t think this is what you want.

You can have a look at the stracktrace to get an idea of which component is trying to render the URL.

BTW: You didn’t specify a scope on your bean. In this case the bean will be @Dependent scoped which will properly not be what you want any MAY cause this issue.

BTW2: Although PrettyFaces offers the @URLMappings for defining multiple mappings for one page I doubt that it makes sense to do so. Every JSF application I developed in the last years is using PrettyFaces for rewriting but I found not a single usercase for @URLMappings. So you could think about if there is some other way to structure your beans.