各位大哥大姐,
    小弟初学JSF,做了个例子,如下
    通过login.jsp调用backing bean中的verify (#user.Verify)方法 ,成功(success)或者失败(failure)则跳到一个result.jsp页面。可是写完例子后,页面就是无法跳转。faces-config.xml的配置我都看过了,大小写也仔细核对,实在是找不到问题所在。
    可是我别外在同一个WEB Project中写了一个例子即MyJsp.jsp 不调用backing bean中的方法,却可以实现跳转。
    多谢大家了。
    (1)login.jsp代码如下:
      
<body>
<f:view>
<h:form>

<h3>请输入姓名</h3>
名称:<h:inputText  value="#{user.userName }"></h:inputText>
<br/>
<h3>请输入密码</h3>
密码:<h:inputText  value="#{user.password }"></h:inputText>
<br/>
输出:<h:outputText value="#{user.errorMessage}"></h:outputText>
<br/>
<br/>
<h:commandButton value="提交" action="#{user.Verify}"></h:commandButton>
</h:form>
</f:view>
</body>
    (2)faces-config.xml的配置如下
 <managed-bean>
  <managed-bean-name>user</managed-bean-name>
  <managed-bean-class>MyBeans.UserBean</managed-bean-class>
  <managed-bean-scope>session</managed-bean-scope>
 </managed-bean>
 <navigation-rule>
  <from-view-id>/MyJsp.jsp</from-view-id>
  <navigation-case>
   <from-outcome>login</from-outcome>
   <to-view-id>/result.jsp</to-view-id>
   <redirect/>
  </navigation-case>
 </navigation-rule>
 <navigation-rule>
  <from-view-id>login.jsp</from-view-id>
  <navigation-case>
   <from-outcome>success</from-outcome>
   <to-view-id>/result.jsp</to-view-id>
   <redirect/>
  </navigation-case>
  <navigation-case>
   <from-outcome>failure</from-outcome>
   <to-view-id>/result.jsp</to-view-id>
   <redirect/>
  </navigation-case>
 </navigation-rule>
</faces-config>