PrettyFaces Navigation?

Splash Forums PrettyFaces Users PrettyFaces Navigation?

This topic contains 3 replies, has 3 voices, and was last updated by  azakovorotny 10 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17794

    kency
    Participant

    Sovled

    Admin please Del topic thank you

    =====RESTORED=====

    Hello Lincoln

    i use Pretty Faces and Navigation for Menu

    i use h:commandLink tag to navigation to other page example register page

    my code such as:

    <h:commandLink value="Register" action="register">

    in faces-config.xml i was navigation follow:

    <navigation-rule>
    <from-view-id>/com/header/header.xhtml</from-view-id>
    <navigation-case>
    <from-outcome>register</from-outcome>
    <to-view-id>/com/content/register/chinhreg.xhtml</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>

    in pretty-config.xml i was config chinhreg.xhtml to:

    `<url-mapping id=”mainRegister”>

    <pattern value=”/register” />

    <view-id>/faces/com/content/register/chinhreg.xhtml</view-id>

    </url-mapping>`

    i can access to http://localhost/myapp/register

    but when i redirect to menu page to chinhreg.xhtml it show full url of chinhreg.xhtml

    such as: http://localhost/com/content/register/chinhreg.xhtml

    why it not show http://localhost/register?

    please help me

    small question: how can i rediret with page include , i use ui:include in main page to include menu inside mainpage, it not redirect to chinhreg.xhtml, menu page just redirect when access it

    http://localhost/com/menu/menu.jsf <=== it can redirect to chinhreg.xhtml but when i access http://localhost/main <== and click on menu to register it not redirect

    Thank You

    Best Regards

    #20264

    Hi Kency,

    Instead of deleting the post, could you tell us how you solved the issue?

    Thanks,

    Lincoln

    #20265

    kency
    Participant

    Hi Lincoln my code was wrong in h:commandLink, action of h:commandLink was wrong and i was fix it

    #20266

    azakovorotny
    Participant

    Hi Lincoln,

    I think it is a common issue with PrettyFaces: when JSF navigation rules are used PrettyFaces mapping does not have a chance to re-write outbound URL. I.e. there is no way to have a login URL written like this http://localhost/login if, for example, the following rule matches:

    `<navigation-rule>

    <from-view-id>/*</from-view-id>

    <navigation-case>

    <from-action>#{identity.logout}</from-action>

    <if>#{not identity.loggedIn}</if>

    <to-view-id>/login.xhtml</to-view-id>

    <redirect/>

    </navigation-case>

    </navigation-rule>`

    with url mapping in pretty-config.xml like this:

    <url-mapping id="login">
    <pattern value="/#{tnt: serviceManager.tenantName}/login"/>
    <view-id value="/dir/login.jsf"/>
    </url-mapping>

    Could it be caused by Seam Faces’ ViewConfig rule?:

    @FacesRedirect
    @ViewPattern("/*")
    @AccessDeniedView("/denied.xhtml")
    @LoginView("/login.xhtml")
    ALL

    thank you.

    Andy

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

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

Comments are closed.