Re: conditional url-mapping

Splash Forums PrettyFaces Users conditional url-mapping Re: conditional url-mapping

#21411

I agree with Lincoln! Just merge the two mappings into one. This should work fine:

<url-mapping id="productsGroupAndProducer" parentId="products">
<pattern value="#{ /[01]/ order }/#{ value }/"/>
<view-id value="/products.html"/>
</url-mapping>

This will capture requests like:

/products/1/MyGroup/
/products/0/MyProducer/

You could then add an action method to the mapping and do whatever you want with the two parameters (order and value). If order is 1 the value will contain a group name and the other way around.

Christian