Code example for ModelAndView

Methods: addObjectsetViewName

0
		CrescentCollections crescentCollections = collectionHandler.getCrescentCollections();
		 
		CrescentCollection selectedCollection = collectionManageService.updateCollectionInfo(request);
		 
		 
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.addObject("crescentCollectionList", crescentCollections.getCrescentCollections());
		modelAndView.addObject("selectedCollection", crescentCollections.getCrescentCollection(selectedCollection.getName()));
		modelAndView.addObject("selectedCollectionName", selectedCollection.getName());
		 
		modelAndView.setViewName("/admin/collectionManageMain");
		 
		 
		return modelAndView;
		 
	} 
	 
	@RequestMapping("/addNewCollection") 
	public ModelAndView addNewCollection(HttpServletRequest request, HttpServletResponse response) throws Exception {