Search code examples
jsfjsf-2prettyfaces

Pretty Faces: Generic URL mapping


Using Pretty Faces 3, I have some mappings like these:

<url-mapping id="search"> 
    <pattern value="/search" /> 
    <view-id value="/views/search.xhtml" />
</url-mapping> 

<url-mapping id="edit"> 
    <pattern value="/edit" /> 
    <view-id value="/views/edit.xhtml" />
</url-mapping> 

Is there any way to define all them using some wildcard, like this?

<url-mapping id="generic"> 
    <pattern value="/*" /> 
    <view-id value="/views/$1.xhtml" />
</url-mapping>

I know is possible to use EL in the view-id value, but I can manage it to work.


Solution

  • Its currently not possible to use a wildcard like this.

    However as you already mentioned you could use a dynaview (EL expression for the view-id) to achieve something similar. We recently fixed a bug that prevented something like this to work correcty. Perhaps you could give 3.3.1-SNAPSHOT a try. My guess is that it will work fine now. Feel free to post a message on the forums if you have any further problems.