Code example for ModelAndView

Methods: addObjectsetViewName

0
    private PersonnelServiceFacade personnelServiceFacade;
 
    @RequestMapping("/changeLocale.ftl") 
    public ModelAndView changeUserLocale(@RequestParam(value = LOCALE_ID, required = false) Short id, HttpServletRequest request) {
        Short currentLocaleId = personnelServiceFacade.changeUserLocale(id, request);
        ModelAndView mav = new ModelAndView();
        mav.addObject("CURRENT_LOCALE_ID", currentLocaleId);
        mav.addObject("LOCALE_LIST", personnelServiceFacade.getDisplayLocaleList());
        mav.setViewName("personnel/changeLocale");
        return mav;
 
    } 
 
}