views:

41

answers:

1

If A.jsf have a commandLink that will navigation to B.jsf, then I would think when I am at page B.jsf, I see http:domain/host/project/B.jsf as the URL. However, I see http:domain/host/project/A.jsf on my address bar. I am always ONE behind when displaying the URL in navigation control. Is there away to fix this? My navigation control is handle inside faces-config.xml.

Try this like Plaudit Design - Web Design suggest. However does not fix it.

<navigation-rule>
    <from-view-id>/CentralFeed.xhtml</from-view-id>
    <navigation-case>
        <from-outcome>CREATE EVENT</from-outcome>
        <to-view-id>/CreateEvent.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
        <from-outcome>CREATE ARTICLE</from-outcome>
        <to-view-id>/WriteArticle.xhtml</to-view-id>
    </navigation-case>
    <navigation-case>
        <from-outcome>PROFILE</from-outcome>
        <to-view-id>/Profile.xhtml</to-view-id>
    </navigation-case>
    <redirect/>
</navigation-rule>
+2  A: 

You need to add the following inside your navigation-rule

<redirect/>

With out the redirect element the redirect is internal. The redirect causes an external redirect so your browser requests the new page.

Plaudit Design - Web Design
It does not work for me. I edit my post with some codes, can u take a look at it?
Harry Pham
It should go inside the navigation case. Note that any request scoped beans will be recreated. Also, if no business action is involved, I'd suggest to just use `h:outputLink`. That's also more SEO friendly. Or if you're already on JSF 2.0, use `h:link` instead.
BalusC
Thank you BalusC +1
Harry Pham