Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Total length of list in using struts 2 tag

Tags:

java

struts2

I iterate a list using Struts 2 tags.

<s:iterator value="popUpScreenDetailsList" status ="rowCounter">
    //do something
<s:/iterator>

Is there a way, by which I can get the length of the list without iterating?

The motivation to do it, is to use javascript to validate checkboxes.

like image 215
Vinoth Kumar C M Avatar asked Jun 17 '11 12:06

Vinoth Kumar C M


2 Answers

If it's a Java List object, then you can also get the length (size) by

<s:property value="%{getPopUpScreenDetailsList().size()}"/>

like image 162
nmc Avatar answered Sep 24 '22 17:09

nmc


<s:property value="popUpScreenDetailsList.size"/>
like image 25
Chathuranga Withana Avatar answered Sep 23 '22 17:09

Chathuranga Withana