@ModelAttribute("StageSearchIds") public Map<String, String> populatewfstepSearchStageIds() { List<Object[]> listvalues = null; Iterator<Object[]> iterator = null; Map<String, String> map = null; try { listvalues = wfstepService.selectStageIds(); map = new HashMap<String, String>(); iterator = listvalues.iterator(); while (iterator.hasNext()) { Object[] objects = (Object[]) iterator.next(); // list.add((String)objects[1]); map.put((String) objects[0], (String) objects[1]); } } catch (Exception e) { e.printStackTrace(); } return map; }