Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get an inner property using tags?

 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • 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
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic