Wildcard navigation rule bug in NavigationHandlerImpl
-----------------------------------------------------
Key: MYFACES-1487
URL: http://issues.apache.org/jira/browse/MYFACES-1487
Project: MyFaces Core
Issue Type: Bug
Affects Versions: 1.1.4
Reporter: Jacob Scherrer
A navigation rule bug is present in
NavigationHandlerImpl.calcMatchingNavigationCase(..)
The bug occurs in the following situation:
given the following navigation rules:
<navigation-rule>
<from-view-id>/foo.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/bar.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<navigation-case>
<from-action>#{randomBean.newFoobar}</from-action>
<from-outcome>success</from-outcome>
<to-view-id>/foobar.jsp</to-view-id>
</navigation-case>
</navigation-rule>
Also:
#{randomBean.newFoobar} returns "success"
If you are in the view /foo.jsp and an action link calling
#{randomBean.newFoobar} is clicked, the first navigation rule will be used. The
reason is that the the rule's actionRef and the current actionRef are never
compared, due to a logic error. This can be fixed by updating
calcMatchingNavigationCase:
--snip--
if (((cazeOutcome == outcome) || (cazeOutcome != null &&
cazeOutcome.equals(outcome))) &&
((cazeActionRef == actionRef) || (cazeActionRef != null &&
cazeActionRef.equals(actionRef))))
{
return caze;
}
--snip--
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira