The method in my Controller is as follows
Code:
protected ModelAndView showForm(HttpServletRequest request, HttpServletResponse response, BindException errors) throws Exception{
TeamMember teamMember = new TeamMember();
List list = new ArrayList();
try {
list = jdbc.getProjectManager();
} catch (Exception e) {
e.printStackTrace();
}
Iterator itr = list.iterator();
while(itr.hasNext()){
teamMember = (TeamMember)itr.next();
}
return new ModelAndView("NewMemberEntry","Model",list);
}
Here I am returning thr List containing the data.
In the JSP I am trying to iterate the List as follows:
Code:
<TD align="left">
<select name="projectManager">
<option value ="0">Select a project manager</option>
<c:forEach var="managerList" items="${Model}">
<option value ="10"><c:out value="${teamMember.projectManagerName}"/></option>
</c:forEach>
</select>
</TD>
Here I am able to get the List size as 3. But unable to display the data in the dropdown.
What should I do?