Re: conditional url-mapping

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

#21407

I’m not sure if I understand you usecase correctly? What do you mean with:

Current mapping dosen’t work, because producer and group are strings

You want two distinct mappings for group and producer? If they only differ by the 0/1 value, why don’t you declare the mapping like this:

<url-mapping id="products">
<pattern value="/products/"/>
<view-id value="/products.html"/>
</url-mapping>

<url-mapping id="productsGroup" parentId="products">
<pattern value="1/#{group}/"/>
<view-id value="/products.html"/>
</url-mapping>

<url-mapping id="productsProducer" parentId="products">
<pattern value="0/#{producer}/"/>
<view-id value="/products.html"/>
</url-mapping>

You could then add different URL actions to the two mappings that do different things (for example change the ordering).

Or didn’t I get your usecase right?