Hi,
I'm using Spring 3.1.1.RELEASE and building a web application. I'm struggling to figure out how I manipulate a java.util.Map (via a JSP) that I want to put in my Model. Here is the method that will serve the JSP page ...
Code:@RequestMapping(method = RequestMethod.GET) public ModelAndView get(final Model model, final Principal principal) { ... final List<Contract> contracts = m_contractSvc.findContractByOrg(orgId); final Map<Contract, Boolean> activeContractsMap = new LinkedHashMap<Contract, Boolean>(); ... model.addAttribute("contractsMap", activeContractsMap); return new ModelAndView("select"); } // getProgramSelect
I would like the Map to be displayed in a series of checkboxes with the label being the key's "name" field. Here's how I plan to process the data ...
Thanks, - DaveCode:@RequestMapping(method = RequestMethod.POST) public ModelAndView registerForPrograms(@ModelAttribute("contractsMap") final Map<Contract, Boolean> activeContractsMap, final Principal principal) { …


Reply With Quote
