Code example for ModelAndView

Methods: addObject

0
        binder.setValidator(new PenaltyFormValidator(viewOrganizationSettingsServiceFacade.getOrganizationSettings(session)));
    } 
     
    @RequestMapping(method = RequestMethod.GET)
    public ModelAndView showForm() {
        ModelAndView modelAndView = new ModelAndView("defineNewPenalty");
        PenaltyFormBean bean = new PenaltyFormBean();
        parametersDto = this.penaltyServiceFacade.getPenaltyParameters();
        configurationDto = this.configurationServiceFacade.getAccountingConfiguration();
         
        modelAndView.addObject("formBean", bean);
        modelAndView.addObject("param", parametersDto);
        modelAndView.addObject("GLCodeMode",  configurationDto.getGlCodeMode());
        return modelAndView;
    } 
     
    @RequestMapping(method = RequestMethod.POST)
    public ModelAndView showPreview(@RequestParam(value = CANCEL_PARAM, required = false) String cancel,
            @ModelAttribute("formBean") @Valid PenaltyFormBean formBean, BindingResult result, SessionStatus status) {
 
Connect your IDE to all the code out there  Get Codota for Java