在页面dataTable中有一个属性为rowIndexVar,这时,只要写成rowIndexVar="index"在循环中输出这个Index就可以了,像下面这样:
<x:dataTable value="#{recu_innerRecruitDemandBB.planList}" width="100%" var="list" rowIndexVar="index" align="center" id="dateList"
                                         headerClass="td_top" columnClasses="td_middle_center,td_middle,td_middle_center,td_middle,td_middle,td_middle_center"
                                         styleClass="table03" >
                         <h:column>
                             <c:facet name="header"><h:outputText value="序号"/></c:facet>
                             <h:outputText value="#{index+1}"/>
                        </h:column>
</x:dataTable>