aspose file tools*
The moose likes Struts and the fly likes how to count entries in logic:iterate and display Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to count entries in logic:iterate and display" Watch "how to count entries in logic:iterate and display" New topic
Author

how to count entries in logic:iterate and display

Hubert Pernegger
Ranch Hand

Joined: Apr 11, 2006
Posts: 49
hi,
my following problem is that i iterate over a collection and I want to display the number of the entries



I have tried it with bean:size but it didn't work, i only get the error message that there is no bean for counter, but actually there is one in the proteinPeptideForm
Hubert Pernegger
Ranch Hand

Joined: Apr 11, 2006
Posts: 49
ok, I have solved the problem, but I want indexId (that is what I'm using) to start with 1, not with index 0
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You can also use the <bean:size> tag to get the size of a collection.


Merrill
Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Your bean:size tag looks wrong to me. Try something like this:

<bean:size id="countValue" name="proPep" property="counter"/>
Number of Entries: <bean:write name="countValue"/>

- Brent
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Brent,

I wasn't giving an example of a correctly formatted <bean:size> tag, I was simply making the statement that this tag can be used to get the size of a collection. Naturallly it has to have all the correct attributes in order to work.
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I was referring to the <bean:size> use in the original post.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to count entries in logic:iterate and display
 
Similar Threads
Data grid
Struts 1.1: Need help with logic:iterate and logic:equals tag
Struts and Hibernate how to display in jsp file
logic:iterate display entries
ServletException: BeanUtils.populate