我有一个导航规则,看起来像这样:导航规则不点火
<navigation-rule>
<display-name>forgotPwd</display-name>
<from-view-id>/login/forgotpwd.jsf</from-view-id>
<navigation-case>
<from-outcome>pass</from-outcome>
<to-view-id>/login/pwdresetcomplete.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>fail</from-outcome>
<to-view-id>/login/forgotpwd.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
所以我这样做是为了触发导航规则:
- 导航到
/login/forgotpwd.jsf?uuid=fed8b3f7-ed33-4941-8306-3d2afbb8d1d0
这页面具有以下形式:
<h:form id="resetForm">
<!-- Omitting the login fields -->
<h:commandButton type="submit" id="resetPassword" value="Save" styleClass="btn small" action="#{registration.resetPassword}" >
<f:param name="uuid" value="#{facesContext.externalContext.requestParameterMap.uuid}" />
</h:commandButton>
</h:form>
(需要作为查询字符串参数传递的UUID,并调用registration.resetPassword功能。)
这里是registration.resetPassword java代码:
(详情略去了)
public String resetPassword() {
// If good
return "pass";
// If bad
return "fail"
}
问题:当它返回“通过”时,导航规则不会触发。它返回到/login/forgotpwd.jsf而不是/login/pwdresetcomplete.jsf
这是因为它有UUID参数附加到它吗?为什么我的导航不开火?
是否有一些log4j日志记录,我可以触发,看看为什么这不起作用?
我一直在想,如果他们已经弄清楚了。是的,我使用JSF 2.0。真是太棒了,谢谢! –
不客气。 – BalusC