Multiple URL mapping domains

Splash Forums PrettyFaces Users Multiple URL mapping domains

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

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

    rafaeltc
    Participant

    Hello, everyone!

    I am developing a web application which uses several templates; each template uses different features of the application which means that it only uses some specific URL mappings.

    Is there a way to setup different config files for each template I use? Or is there a way to separate mappings for different templates?

    #22050

    Hello Rafael,

    You should take a look at OCPsoft Rewrite if you want to use domain specific configurations. Unfortunately, however, PrettyFaces itself does not consider this type of information – however, we’d love some help in making that happen.

    http://ocpsoft.com/rewrite/

    https://github.com/ocpsoft/rewrite/blob/master/showcase/multi-domain/src/main/java/com/ocpsoft/rewrite/showcase/domain/DomainRewriteConfiguration.java

    ~Lincoln

    #22051

    rafaeltc
    Participant

    Hello Lincoln. I did not express myself very clearly.

    My application follow this scheme: http://weblogs.java.net/blog/lamineba/archive/2011/08/28/multi-templating-jsf-2-prototype.

    I use a multi-templating architecture. The issue is that some templates use the pages A, B and C. And others use B, D and E.

    For now, my pretty-config.xml has the mapping for A, B, C, D, and E.

    The question is if there is a way to map according to the template. So I can easily throw 404 in case the user tries to access the pages D and E while using the template which has only A, B, and C.

    PS.: The folder structure includes all the pages which are directly accessed by the user. And these pages include the corresponding content according to the template they belong with the tag <ui:include src=”#{bean.template}/pages/mypage.xhtml” />.

    Ex.:

    Templates: t1 and t2.

    General pages: home.xhtml, contact.xhtml, content.xhtml

    t1 pages: home.xhtml and contact.xhtml

    t2 pages: home.xhtml and content.xhtml

    if i have all the mapping in my pretty-config.xml and I try to access content.xhtml while I am using the template t1, I will have a blank page instead of 404. Unless if I create a filter for that, but I dont want to use a filter because it might get too big.

    But I don’t think it is possible to do what I was thinking because there would be the need to switch between different config files during runtime without restarting the application.

    Could you get it? It is kinda hard and confusing to explain

    #22052

    rafaeltc
    Participant

    It could be some kind of special condition to load the mappings, according to a previously loaded variable.

    #22053

    We would be glad to consider an extension to handle this scenario, but it would likely need to be something that you prototyped yourself and provided a patch (we would obviously help!) but we don’t have much time to implement a very complex and specific feature like this since we do this in our spare time :)

    My initial reaction is to say that you might be able to use a custom Processor for this… http://ocpsoft.com/docs/prettyfaces/3.3.2/en-US/html/inbound_rewriting.html#inbound_rewriting.options

    Are you interested in seeing if we can get this to work?

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

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

Comments are closed.