File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Binding collections to Spring form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Binding collections to Spring form" Watch "Binding collections to Spring form" New topic
Author

Binding collections to Spring form

Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

I am trying to bind a collection of values to Spring form but I get the following error. I tried to do it with LazyList but still the same issue. Any pointer to the correct article which can help me get started?

javax.servlet.ServletException: org.springframework.beans.InvalidPropertyException : Invalid property 'parameters[0]' of bean class [beans.Input]: Index of out of bounds in property path 'parameters[0]'; nested exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0


===Vyas Sanzgiri===
My Blog
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
The list must have at least one data (index 0).


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

It has information but the binding is not working. List has more than 1 element in my test case
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
You should try to debug then, it tried to access something that has no data in list.
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

I understand that !! but I am not able to figure out. I tried to debug but I do not want to go under the covers into Spring framework.
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
Vyas Sanzgiri wrote:I understand that !! but I am not able to figure out. I tried to debug but I do not want to go under the covers into Spring framework.

When you debug, you're supposed to debug in Spring Framework code to see what actually happens.
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

I do not want to debug the Spring framework code. I would rather concentrate on my business logic
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You're not debugging Spring framework code - it's not just magically losing values - you're debugging how *you're* using Spring framework code.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

Figured it out http://www.coderanch.com/t/61337/Spring/Binding-with-ArrayList-Spring#2041973
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Binding collections to Spring form