File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes logic:iterate - not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic:iterate - not working" Watch "logic:iterate - not working" New topic

logic:iterate - not working

Johann Evans
Ranch Hand

Joined: Nov 18, 2002
Posts: 47
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

Joined: Mar 09, 2001
Posts: 2676
Would you mind posting your code?

Matthew Phillips
Johann Evans
Ranch Hand

Joined: Nov 18, 2002
Posts: 47
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!
I agree. Here's the link:
subject: logic:iterate - not working
It's not a secret anymore!