【发布时间】:2015-11-21 05:11:26
【问题描述】:
我有一个 JSF 应用程序,需要登录
<h:commandButton id="btnLoginId" value="Login" action="#{UserLoginMB.login}" styleClass="loginPanelBtn"></h:commandButton>
它可以工作并向 managedBean 感知“正确”的结果,
public String login() {
// ...
return "correct";
}
之后,返回显示:
Impossible de trouver un cas de navigation 通讯员 depuis l'ID de vue «/home/index.xhtml» pour l'action «#{UserLoginMB.login}» avec le résultat «正确»。
这意味着无法找到与视图 home/index.xhtml 的 ID 相对应的导航方式(Bean.login),结果“正确”
虽然我已将 Faces 配置设置为重定向到 /home/backend/index.xhtml,以防成功(正确返回),
<!-- navigation-rule for login.xhtml -->
<navigation-rule>
<from-view-id>/home/index.xhtml</from-view-id>
<!-- navigation-case for method login() -->
<navigation-case>
<from-action>#{userLoginMB.login}</from-action>
<from-outcome>correct</from-outcome>
<to-view-id>/home/backend/index.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
在 apache 日志中:
AVERTISSEMENT: JSF1064 : Impossible de localiser ou de servir une 资源,/home/correct.xhtml.
这意味着无法本地化资源 /home/correct.xhtml 而我从未使用过这样的资源。
【问题讨论】:
标签: jsf jsf-2 navigation