Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.1-core
-
None
Description
While iterating a collection using forEach Tag if the value specified using the end attribute matches the size of the collection ArrayIndexOutOfBoundsException is thrown.
The Exception is not thrown if the end attribute is more than or less than the size of the list.
The following sample code can be used to reproduce the bug.
Ex:-
Managed Bean:-
------------------------
The Dept class depends on Employee class which just has one field named "name" with accessors.
public class Dept {
public Dept()
public List getEmployees()
{
List employees = new ArrayList();
for(int i=0;i<10;i++)
return employees;
}
}
JSf code:-
--------------
<af:forEach begin="0" end="10" var="item" items="#
{dept.employees}"
varStatus="dd">
<af:outputText value="(#
)--#
{item['name']}--"
inlineStyle="width:132px; font-weight:bold;" id="ot3"/>
</af:forEach>