How to create mask like /pages/admin/**

Splash Forums PrettyFaces Users How to create mask like /pages/admin/**

This topic contains 1 reply, has 2 voices, and was last updated by  Lincoln Baxter III 6 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17847

    aareshchanka
    Participant

    Could you please tell me is it possible to make make mask like mentioned in title, I didn’t find correct example in samples in google repository. I tried different variants but wasn’t successful.

    I want to make something like this:

    <url-mapping id=”adminView”>

    <pattern value=”/pages/admin/**” />

    <view-id>/pages/admin/main.jsf</view-id>

    <action>#{securityController.check}</action>

    </url-mapping>

    I’m using JSF2.

    Thanks, Alex.

    #20580

    Hi Alex,

    The pattern is a regular expression. Try something like this:

    <url-mapping id="adminView">
    <pattern value="/pages/admin/.*" />
    <view-id>/pages/admin/main.jsf</view-id>
    <action>#{securityController.check}</action>
    </url-mapping>

    This may, however, cause problems when generating URLs, so something like this (using regex parameter constraints) might be more appropriate:

    <url-mapping id="adminView">
    <pattern value="/pages/admin/#{ /.*/ page }" />
    <view-id>/pages/admin/main.jsf</view-id>
    <action>#{securityController.check}</action>
    </url-mapping>

    http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html_single/#config.pathparams.regex

    -Lincoln

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

You must be logged in to reply to this topic.

Comments are closed.