Inherit from a parent URL-mapping Documentation

Splash Forums PrettyFaces Users Inherit from a parent URL-mapping Documentation

This topic contains 4 replies, has 3 voices, and was last updated by  Lincoln Baxter III 10 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #18098



    Currently trying to add PrettyFaces 3.3.2 to my projects so today was an intense reading of the full documentation. Everything was fine until I read about inheritance mapping

    I’ve made a few tests, and maybe I’m wrong, but seems to me that for a child, the final pattern will be the strict concatenation of all the parent’s patterns, adding itself finally. So, in the documentation example, if you have :

    <url-mapping id="store">

    <pattern value="/store/" />

    <~-- Result: /store/ -->

    <view-id value="/faces/shop/store.jsf" />


    <url-mapping parentId="store" id="category">

    <pattern value="/#{category}" />

    <~-- Result: /store/#{category} -->

    <view-id value="/faces/shop/category.jsf" />


    The result is not “/store/#{category}” but “/store//#{category}” because both the final slash of the parent and the first slash of the child are concat. At least, it is what happens in my project. I can paste the full code of my pretty-config.xml and the url mapped if necessary.



    That sounds right. So I would not start the child mapping with a ‘/’ in this case.

    Does that work?



    Yes, that’s what I’ve done on my project : no child pattern starts with a “/” since it is already provided by the parent.


    @lincoln: I guess we should change the example in the documentation as it is not entirely correct. If we remove the trailing slash from the first mapping everything would be correct.


    @chkal, yes, let’s do that.

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.