0

如果A.jsf有一个commandLink可以导航到的B.jsf,那么我会认为当我在 page 时B.jsf,我会看到http:domain/host/project/B.jsfURL。但是,我http:domain/host/project/A.jsf在地址栏上看到了。在导航控件中显示 URL 时,我总是落后。有没有办法来解决这个问题?我的导航控件是里面的句柄faces-config.xml

试试这个像Plaudit Design - Web Design建议。但是没有修复它。

<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>
4

1 回答 1

3

您需要在导航规则中添加以下内容

<redirect/>

没有重定向元素,重定向是内部的。重定向会导致外部重定向,因此您的浏览器会请求新页面。

于 2010-10-11T19:53:43.167 回答