Re: Generic URL mapping, is it possible ?

Splash Forums PrettyFaces Users Generic URL mapping, is it possible ? Re: Generic URL mapping, is it possible ?

#21502

I think you are right! There is something strange happening when I try your configuration. I built a test application reproducing it. But I need more time to look into this issue in detail.

But I can confirm that this configuration works fine:

<url-mapping id="generic">
<pattern value="/#{dynamicViewBean.path}.html" />
<view-id value="#{dynamicViewBean.getViewId }" />
</url-mapping>

Could you test it? In this configuration every request ending with .html will be mapped to the corresponding JSF page. I know that is not what you want, but just give it a try.

However these generic configuration you are trying to implement will bring some other problems. For example outbound rewriting won’t work. So your <h:link> won’t be rewritten correctly. And I don’t think it is possible for PrettyFaces to implement something like this due to the dynamic nature of dynaview.

The most common practice is to add one URL mapping per page to your configuration. This will definitively work without problems. Another option would be to experiment with rewrite rules because they also offer an outbound attribute that you could set to true if you want to rewrite outbound URLs. So you could rewrite inbound and outbound URL.

Christian