If you are using myfaces implementation use tomahawk <t:dataTable />
tag therefore its rowIndexVar attribute works as i in your given
example refer to the following link for tag reference:
myfaces.apache.org/tomahawk/tagreference.html
In case you are using standard JSF or your utilized implementation of
JSF doesn't have any facility like above ,still you can use the
following trick, declare loop index in your bean class and define
getter , setter and increment methods for it. Explore the details of
this solution and the way you can use these methods.
Another solution is available if you are using JSF 1.2 that is to use
JSTL mixed with your JSF tags. I hope it helps.