Search code examples
javajspstruts2displaytagognl

Is there a chance to get the size of a list property in Struts 2?


Is there a chance to get the size of a property which is a list?

<display:column property="reminderSend" title="Anzahl der Mahnungen" 
                sortable="true" />

reminderSet is a list. I want to display the size of it and not the values.


Solution

  • The OGNL even has a pseudo-property for collections. Suppose you have uid="row" on the table then

    <display:column title="Anzahl der Mahnungen">
      <s:property value="%{#attr.row.reminderSend.size}"/>
    </display:column>