This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

Returning List from Controller and iterate over it in the JSPPage Title Module

Returning List from Controller and iterate over it in the JSP

Dec 21st, 2005, 05:00 AM

Hi all.
I am returning List in ModelAndView from the Controller.
I want to iterate over this List in the JSP and show the values in a combo box.
I am using <c:forEach> tag.
I am able to iterate the List for 'n' times(n= number of elements in the List)
But I am not able to show the values in the combo box.

Comment

You appear to be assigning a variable, managerList, in your c:forEach but then not using it in the code within the loop. Also, you're not doing anything with teamMember in your Java code (you're just looping through them). If you change the name of your var in the JSP, thus, I imagine it will work (assuming that the list in the object called 'Model' is a list of TeamMember objects - if not, make sure it is in your controller code).