Code example for ModelAndView

Methods: addObject

0
     
    private final SitePreferenceHelper sitePreferenceHelper = new SitePreferenceHelper();
     
    @RequestMapping(value = "/viewSavingsAccountDetails", method=RequestMethod.GET)
    public ModelAndView showSavingsAccountDetails(HttpServletRequest request, HttpServletResponse response) {
        ModelAndView modelAndView =new ModelAndView();
        sitePreferenceHelper.resolveSiteType(modelAndView, "viewSavingsAccountDetails", request);
        modelAndView.addObject("include_page", new IncludePage(request, response));
         
        String globalAccountNum = request.getParameter("globalAccountNum");
         
        SavingsAccountDetailDto savingsAccountDetailDto = savingsServiceFacade.retrieveSavingsAccountDetails(globalAccountNum);
        modelAndView.addObject("savingsAccountDetailDto", savingsAccountDetailDto);
         
        boolean containsQGForCloseSavings = false;
        containsQGForCloseSavings = questionnaireServiceFacade.getQuestionGroupInstances(savingsAccountDetailDto.getAccountId(), "Close", "Savings").size() > 0;
        modelAndView.addObject("containsQGForCloseSavings", containsQGForCloseSavings);
         
        modelAndView.addObject("backPageUrl", UrlHelper.constructCurrentPageUrl(request));
         
        savingsServiceFacade.putSavingsBusinessKeyInSession(globalAccountNum, request);
         
        // for mifostabletag 
        request.getSession().setAttribute("recentActivityForDetailPage", savingsAccountDetailDto.getRecentActivity());