我遵循了特立尼达导航开发指南中的第一个示例,但结果链接始终显示为“#”。我仔细检查了他们的可下载示例,但没有看到任何区别。
Main.xhtml
<tr:page>
<f:facet name="menuSwitch">
<tr:navigationPane hint="button">
<tr:commandNavigationItem text="Home" action="nav_main" />
<tr:commandNavigationItem text="About" />
<tr:commandNavigationItem text="Login" action="nav_login" rendered="#{!loginBean.loginStatus}" />
<tr:commandNavigationItem text="Logut"
rendered="#{loginBean.loginStatus}" />
</tr:navigationPane>
...snip
</tr:page>
面-config.xml中
<navigation-rule>
<navigation-case>
<from-outcome>nav_main</from-outcome>
<to-view-id>/main.xhtml</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>nav_login</from-outcome>
<to-view-id>/login.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
main.xhtml和login.xhtml都位于WebContent中,不会埋没在另一个文件夹中。
我读了这个链接:http://myfaces.apache.org/trinidad/devguide/navigation.html
答案 0 :(得分:0)
<tr:page>
<f:facet name="menuSwitch">
<tr:form>
<tr:navigationPane hint="button">
<tr:commandNavigationItem text="Home" action="navMain" />
<tr:commandNavigationItem text="About" />
<tr:commandNavigationItem text="Login" action="navLogin" rendered="#{!loginBean.loginStatus}" />
<tr:commandNavigationItem text="Logut"
rendered="#{loginBean.loginStatus}" />
</tr:navigationPane>
</tr:form>
</f:facet>
...snip
</tr:page>