This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
This is officially my first post. I'm new to developing with struts and am trying to use nested tags without a form.
In my action, I have a sql statement that returns a list of objects. Within each object in the list, there can be a number of child objects some of which can be other Lists of objects. Once the original list of objects has been returned, I put it into scope like this:
So now in my jsp what I want to do is iterate through the List of objects and then iterate through the child objects as well. After I set the root nested object to be this request attribute (List), how do I begin to iterate through the list? In other words, how do I get access to the first object in the list in order to serve as the point of reference for any subsequent iteration calls within this root nested tag? When I try to use the <nested:iterate> tag on the List, a get a nullPointerException. When I simply set the request attribute to be an object instead of a list, I don't have any problems. But I need this attribute to be a list as there can be 1 to many objects returned by the sql statement. Here is a dried out version of what I have (unnecessary table tags removed for simplicity)
<nested:write property="num" /> /* a property of parent obj in list */ <nested:iterate property="line"> /* a line child object */ <nested:write property="lineNum" /> /* a prop of child object */ </nested:iterate>
Any help would be much appreciated...thanks!!!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com