I am converting my controllers to annotated style controllers in spring mvc.
Basically I do this in the old style controller simpleformcontroller.
protected Map referenceData(HttpServletRequest request) throws Exception {
Map referenceData = new HashMap();
List<ItemVo> lstItem1 = eqrManager .searchAllEqptCondQualItems("A1", "BOXES"); List<ItemVo> lstItem2 = eqrManager.searchAllEqptFullQualItems("A2", "CANNED_GOODS"); referenceData.put("BOX_ITEMS", lstItem1);
referenceData.put("CANNED_ITEMS", lstItem2);
return referenceData;
}
I do below way by taking model as a input argument,But it is calling only one time,How can i make below method should call everytime when form submission happens.
@RequestMapping(method=RequestMethod.GET) public void setUp(Model model) {
model.addAttribute("CANNED_ITEMS", eqrManager.searchAllEqptFullQualItems("A2", "CANNED_GOODS")) .addAttribute("BOX_ITEMS", eqrManager.searchAllEqptCondQualItems("A1", "BOXES")); }
Regards,
Raj