kev*_*dez 1 navigation faces-config jsf-2
有没有办法<to-view-id>在支持bean中获得导航案例?
让我们说我想<to-view-id>从结果中得到结果success,这应该是page1.xhtml.有没有帮手功能?
<navigation-rule>
<from-view-id>start.xhtml</from-view-id>
<navigation-case>
<from-action>#{pageController.processPage1}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>page1.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{pageController.processPage2}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>page2.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
Run Code Online (Sandbox Code Playgroud)
如果它有帮助,我正在使用PrettyFaces.
你可以NavigationCase从a 获得一个ConfigurableNavigationHandler.该NavigationCase代表配置的导航的情况下,你可以让你从这个对象需要的所有信息.注意:
ConfigurableNavigationHandler configNavHandler = (ConfigurableNavigationHandler)ctxt.getApplication().getNavigationHandler(); //assumes you already have an instance of FacesContext, named ctxt
NavigationCase navCase = configNavHandler.getNavigationCase(ctxt,null,"success");
String toViewId = navCase.getToViewId(ctx); // the <to-view-id>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1626 次 |
| 最近记录: |