You should be able to get members.size() if you use OGNL and a <s:property> tag. You can also use JSTL functions and the "length" function.
http://java.sun.com/j2ee/1.4/docs/tutorial-update2/doc/JSTL8.html Matt On Mon, Apr 28, 2008 at 9:16 AM, Martin Homik <[EMAIL PROTECTED]> wrote: > > Problem: > * I have a "Group" POJO which keeps a list of its "members" (ManyToMany > relation). > * The GroupAction class stores a list of my current groups and it has a > group field for > accessing information of a single group. In principle, the stucture is > very similar to the > PersonAction of the online tutorial. > > Question: In the JSP, I iterate through the groups and print some group > information. For each group, I'd like to print the number of members. How do > I get it? Can I access somehow members.size() in the JSP? Or am I on a > completely wrong path? > > Note: I tried a few things by try-and-error and sometimes I ended up with a > Hibernate LazyInitializationException. Now, I just don't know at what end to > continue? Is it something that > i) can be solved simply via JSP and some expression, or > ii) do I have to do something in the Action class, or > iii) does it go further down into the persistence layer? > > Hope, my mail is not too short and you understand my problem. > -- > View this message in context: > http://www.nabble.com/How-to-access-collection-fields-in-Struts2--tp16941170s2369p16941170.html > Sent from the AppFuse - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]