Code example for ModelAndView

Methods: addObjectsetViewName

0
		String selectedCollectionName = request.getParameter("col_name");
		if(selectedCollectionName == null) {
			selectedCollectionName = crescentCollections.getCrescentCollections().get(0).getName();
		} 
		 
		ModelAndView modelAndView = new ModelAndView();
		//modelAndView.addObject("crescentCollections", crescentCollections); 
		modelAndView.addObject("selectedCollectionName", selectedCollectionName);
		 
		List<CrescentCollection> crescentCollectionList = crescentCollections.getCrescentCollections();
		 
		modelAndView.addObject("crescentCollectionList", crescentCollectionList);
		modelAndView.addObject("selectedCollection", crescentCollections.getCrescentCollection(selectedCollectionName));
		modelAndView.setViewName("/admin/searchTestMain");
		 
		logger.debug("search Test main"); 
 
		return modelAndView;
	} 
 
Contextual code suggestions in your IDE  Get Codota for Java