也许我犯了愚蠢的错误。但我找不到它。这是代码,一切都很好。就可以切换到正确的页面。/
<navigation-rule>
<from-view-id>/index.xhtml</from-view-id>
<navigation-case>
<from-action>#{user.isUserValid}</from-action>
<from-outcome>true</from-outcome>
<to-view-id>/loginSuccess.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-action>#{user.isUserValid}</from-action>
<from-outcome>false</from-outcome>
<to-view-id>/loginFail.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
xHtml 页面
<body>
<h:form>
<h:outputLabel value="Username:" />
<h:inputText value="#{user.username}" />
<br></br>
<h:outputLabel value="Password:" />
<h:inputSecret value="#{user.password}" />
<br></br>
<h:commandButton action="#{ user.isUserValid }" value="Login"></h:commandButton>
</h:form>
<h:outputLabel value="#{user.loginState}" />
</body>
路径是正确的。不知道问题出在哪里