• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get an inner property using tags?

 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all-

I'm trying to get a nested value from a bean: (I want the count of items)

in my JSP:
<nested:nest name="feeManagementForm" property="feeFormBeans">
<nested:write property="itemCount" />
</nested:nest>

the error I get is:

No getter method for property feeFormBeans.itemCount of bean feeManagementForm

(in my Bean 'feemanagementForm'

public List getFeeFormBeans() {
return feeFormBeans;
}

it's a List--why can't I access properties of List?
because it's not a String?

thanks!
Max
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can access individual items in a list using the <logic:iterate> or <nested:iterate> tags. Check the documentation for how to use them. If you just want to display the number of items, put the following code in your form bean:


Then simply code:

<bean:write name="feeManagementForm" property="itemCount" />

in your jsp.
[ July 14, 2005: Message edited by: Merrill Higginson ]
 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Merrill
I was aware that I could simply add methods to my form bean -- I was hoping there was a more dynamic way to get these kind of values.
But I've wasted enough time on it.
thanks for the quick reply.
Max
reply
    Bookmark Topic Watch Topic
  • New Topic