My list is empty when the jsp is rendered and i am creating this text field dynamucally. As per what i have read if i have the above code a new object will be created in the list and corresponding property field will be populated. But this is not happening.
I replaced the code with
Consider that i am properly updating that index.
Here I found that the new object is created but the property is not being set to the value entered in the textfield.
Are you sure your getters and setters are correct? Do you have indexed getters and setters. I had a similar problem when I first switched to Struts2 and the problem turned out to be that I wasn't using the generics correctly. Posting your getter and setter code might help.
paddy Mahadeva Iyer
Joined: Feb 10, 2007
Thanks. Same problem here! Generics
I don't know how this works but this is what happened with me. One of my variables is of Type T where T extends Object. So what happened. I had set the generic where i declared the object that T would be string. Once i removed the generic it started working. But that gave me a new problem. For each textfield it was setting in a string array of size 1 with the value in the text field at position 0. I have no idea how struts tried to set a string value as string array into the variable.