posts - 0,  comments - 0,  trackbacks - 0
       In addition to the from-outcome element, there is also a from-action element. That flexibility can be useful if you have two separate actions with the same action string or two action method expressions that return the same action string.

        For example, suppose that in our quiz application, the startOverAction returns the string "again" instead of "startOver". The same string can be returned by the answerAction. To differentiate between the two navigation cases, you can use a from-action element. The contents of the element must be identical to the method expression string of the action attribute:

  <navigation-case>
     
<from-action>#{quiz.answerAction}</from-action>
     
<from-outcome>again</from-outcome>
     
<to-view-id>/again.jsp</to-view-id>
  
</navigation-case>
  
<navigation-case>
     
<from-action>#{quiz.startOverAction}</from-action>
     
<from-outcome>again</from-outcome>
     
<to-view-id>/index.jsp</to-view-id>
  
</navigation-case>
                       上文出自:《core JavaServer™ Faces, Second Edition》
posted on 2007-12-11 18:52 *一凡* 阅读(179) 评论(0)  编辑  收藏 所属分类: JSF