Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

logic:iterate - not working

 
Johann Evans
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just cant seem to get the logic:iterate tag to work!
Keep telling me it cannot find the bean xxx in scope null. This of course being the bean from which I write within the iteration and which is the id attribute of the iterate tag.
Is there anymore samples somewhere?
 
Matthew Phillips
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you mind posting your code?
 
Johann Evans
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used an enumeration for the property value that is returned as an array and this did not work, so I changed it to a Hashtable and it seem to work now - here is my old code:
This is the iteration:

The Client class had a
public Title[] getTitles() {
}
and inside it I used like the sample code from the example to change it to an array, except, the titles property in client is of TitleSet, my own class implementing Enumeration. Therefore a first copied the enumeration to a Vector and then used the example code to take it back to an enumeration. The reason: I dont know how to get the size of an Enumeration??? But it all compiled inevitably. And that's where I got the problem...
Well, I think it might be my own fault afterall - would just like to see a bit more elaborate documentation on Struts - sometimes difficult for a newbie to get everything done!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic