Friday 15 April 2011

spring - having trouble using @ModelAttribute with @ResponseBody -


I have a requirement, where I have to populate the table on the AJAX call. I am using jquery ajax and spring mvc Below is the code that I am using to use modelatitrate, but when I go to the JSP Model Template, it is not available at all. Any help would really be appreciated. @RequestMapping (value = "/ getFullSchedule", Method = RequestMethod.GET, Production = "Application / Jason") Public @ResponseBody ScheduleLine Display FullSchedule (@ModelAttribute ("Schedulben") Scheduling Schedule Schedule String Caller ID, @RevenParam (value = "callCenterId", required = true, defaultwall = "-1") string call center ID, @RequestParam (value = "qiid", required = true, defaultwall = "-1") string queue id, Model model) throws service expeditions {complete} for logger.debug ("callCenterId (" + callCenterId + ") and queueId (" + queueId + ")" To brief;); QiSchedule Complete Filling Schedule = Schedule Service Service .get7DaySchedule (callCenterId, queueId); Logger.debug (fullSchedule); // Schedule Schedule Schedule = New ScheduleBin (); ScheduleBean.setCallCenterId (fullSchedule.getCallCenterId ()); ScheduleBean.setQueueId (fullSchedule.getQueueId ()); ScheduleBean.setVdnDesc (fullSchedule.getVdnDesc ()); Collections & lt; DaySchedule & gt; Days = new arreelist & lt; Day schedule & gt; (); Days.add (fullSchedule.getWeeklySchedule () getMonday ().); Days.add (fullSchedule.getWeeklySchedule ()) getTuesday ().); Days.add (fullSchedule.getWeeklySchedule () getWednesday ().); Days.add (fullSchedule.getWeeklySchedule ()) getThursday ().); Days.add (fullSchedule.getWeeklySchedule ()) getFriday ().); Days.add (fullSchedule.getWeeklySchedule ()) getSaturday ().); Days.add (fullSchedule.getWeeklySchedule () getSunday ().); ScheduleBean.setDays (days); Model.addAttribute ("ScheduleBan", ScheduleBen); Model.addAttribute ("Animate", "Examination"); Return schedule; }

and the jsp part looks like bottom

   & Lt; Display: table htmlId = "scheduleTable" name = "$ {scheduleBean.days}" pagesize = "15" export = "false" type = "list" cellpadding = "0" cellspacing = "0" width = "100%" RequestURI = "" Id = "full sidelle" align = "left" square = "pure-table net-table-border" & gt; & Lt; Display: column title = "ABC" & gt; & Lt; Div & gt; $ {FullScheduleTable.startTime} & lt; / Div & gt; & Lt; / Display: Columns & gt; & Lt; / Display: table & gt;  

Nothing in the Model or ModelAttribute is available on the jsp page.

I have also added Jackson Mapper to the Dispatcher-servlet and still not.

  & lt; Mvc: annotation-operated / & gt; & Lt; Bean id = "jackson message converter" class = "org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />  


No comments:

Post a Comment