Apllying one URL mapping for all urls

Splash Forums PrettyFaces Users Apllying one URL mapping for all urls

This topic contains 2 replies, has 2 voices, and was last updated by  cklbutler2007 8 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #19485


    In order to rewrite an URL, we just need to remove ‘.jsf’ extension. SO instead of appending so many url-mappins in pretty-config, we thought that it could be possible to use only one url-mapping that does the whole thing.

    Here is the basic mapping:

    <url-mapping id=”contact”>

    <pattern value=”/company/contact” />

    <view-id value=”/company/contact.jsf” />


    We need to apply the same thing to all other urls so that /company/something.jsf becomes /company/something.

    Thought about a REGEX & a parameter name but couldn’t figure how to.

    COuld please guide us.



    Unfortunately this is currently not possible with PrettyFaces. The recommended way is to create one mapping for each mapping.

    If you really want to simplify the configuration, you could have a look at Rewrite, which is the successor of PrettyFaces.


    You can have a look at the example to get an idea how Rewrite works:

    Rewrite Examples

    You could implement your usecase with something like:

    .addRule( Join.path("/company/{p}").to("/company/{p}.jsf").where("p").matches("[a-z]+") )


    Thanks Christian,

    That’s the information we needed to know.


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

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

Comments are closed.