Kris Kaz

+ Follow
since Jul 23, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kris Kaz


I'm running into a problem and it's driving me crazy. It seems to me that the solution should be so simple, but I'm obviously missing something. Hopefully someone can shed some light for me.

I have a jsp page that contains a dataTable which iterates through a collection of type list. Then for each record (row) in the dataTable, an output text, selectBooleanCheckbox, commandButton, and commandLink are displayed. The commandButton and commandLink are attached to an action method on my page code bean that should be called when the button is clicked.

My problem is this. When I click on either the button or text link, the form is reposted and my action is never called. I remedy this by setting the 'immediate' attribute to true so that I ensure the method is called right away. This causes another problem. The model is not updated by the time I get to my action method.

Am I missing something here? How can I make sure that the model is updated first and then the action is called.

Please help!

16 years ago
Hello everybody-

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:

request.setAttribute("resultsList", resultListObj);

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:root name="resultsList">
<nested:iterate name="resultsList">

<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 */


Any help would be much appreciated...thanks!!!

17 years ago