File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get an inner property using tags?

 
Max Tomlinson
Ranch Hand
Posts: 365
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic