Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've a list of values to be passed from my controller to the jsp page. I've the below controller:

Java
@RequestMapping(value="/addClient.do", method = RequestMethod.GET)
protected ModelAndView Submit(HttpServletRequest request, HttpServletResponse response) throws Exception {

    MyForm = new MyForm();


    MyForm.setClientList(MyService.getClientList(/*"30-JUN-15"*/));

    System.out.println("Size of list : "+MyForm.getClientList().size()); //-- Displayed as 10 which is correct

    ModelAndView model = new ModelAndView("feeMaintenance");
    model.addObject("clientForm",MyForm);
    model.addObject("selectedMenu", "MenuSelected");
    model.addObject("clientsList",MyForm.getClientList());
    return model;
}


And my jsp form is as below:

HTML
<body>
<form:form method="post" modelAttribute="clientForm" action="${userActionUrl}">
<tr>    <td align="left">
         <form:select path="clientList">  
            <form:option value="-" label="------Select Client ------">  
            <form:options items="${clientsLists}">  
        </form:options></form:option></form:select>  

</tr>   </td>
</form>
</body>


I've removed the additional unrelated code. The drop down only shows ----Select Client--- even though the controller shows the correct values of the clientList. Unable to figure out whats missing.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900