• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL nested Collection Exception  RSS feed

 
Tom Henricksen
Author
Ranch Hand
Posts: 144
5
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a hybrid object that has List variable of traits. When I try this nested for each in my JSP I am getting an exception.



This is the exception I get:

500 Servlet jspservlet: unable to service request: An error occurred while evaluating custom action attribute "items" with value "${hybridRCs.dynamicTraits}": The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer. (null)

I am doing something similar with a nested for each and it is working fine. The only difference is that is a separate object not a variable to the other object. The rest of my JSTL code is working great.
Thanks,
Tom
 
Stefan Evans
Bartender
Posts: 1836
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably a type in the second forEach loop.
You have items of ${hybridRCs.dynamicTraits} which refers to your LIST.
Should you not be referring to the var hybridRC - ie withuot the "s"?


 
Tom Henricksen
Author
Ranch Hand
Posts: 144
5
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stefan that did the trick. I am the master of dumb mistakes...
Tom
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!