ModelAndView setViewName - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ModelAndView setViewName method.

This code example shows how to use the following methods:addAllObjects, setView, setViewName
					return null; 
				} 
			} 
		} 
 
		ModelAndView modelAndView = new ModelAndView(); 
		modelAndView.addAllObjects(RequestContextUtils.getInputFlashMap(request)); 
 
		if (getViewName() != null) { 
			modelAndView.setViewName(viewName); 
		} 
		else { 
			modelAndView.setView(getView()); 
		} 
 
		return (isStatusOnly() ? null : modelAndView); 
	} 
 
} 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addAllObjects, addObject, setView, setViewName
 
        map.put("artist", request.getParameter("artist")); 
        map.put("song", request.getParameter("song")); 
 
        ModelAndView result = super.handleRequestInternal(request, response); 
        result.addObject("model", map); 
        return result; 
    } 
} 

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addObject, setViewName
        } 
 
        String requestUri = request.getRequestURI();
        logger.error("Uncaught exception while accessing '" + requestUri + "'", cause);
 
        ModelAndView mm = new ModelAndView();
        mm.setViewName("uncaughtException");
        mm.addObject("uncaughtException", cause);
        mm.addObject("requestUri", requestUri);
        if (cause != null) {
            Writer result = new StringWriter();
            cause.printStackTrace(new PrintWriter(result));
            mm.addObject("stackString", result.toString());
        } 
        return mm;
    } 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addObject, setViewName
    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;
 
    } 
 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addAllObjects, addObject, setView, setViewName
            uploadDirectory = new File(musicFolders.get(0).getPath(), "Incoming").getPath(); 
        } 
 
        Player player = playerService.getPlayer(request, response); 
        ModelAndView result = super.handleRequestInternal(request, response); 
        result.addObject("model", map); 
        map.put("user", securityService.getCurrentUser(request)); 
        map.put("uploadDirectory", uploadDirectory); 
        map.put("genres", mediaFileService.getGenres()); 
        map.put("currentYear", Calendar.getInstance().get(Calendar.YEAR)); 
        map.put("musicFolders", settingsService.getAllMusicFolders()); 
        map.put("clientSidePlaylist", player.isExternalWithPlaylist() || player.isWeb()); 
        map.put("brand", settingsService.getBrand()); 
        return result; 
    } 
 
    public void setSettingsService(SettingsService settingsService) { 
        this.settingsService = settingsService; 
    } 
 

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addObject, setViewName
	 
	@RequestMapping(value="/submitCredentials") 
	public ModelAndView setupToodledo(HttpServletRequest request, HttpServletResponse response)
		throws RateLimitReachedException, ExceptionModelAndView mav = new ModelAndView();
		String email = request.getParameter("username");
		String password = request.getParameter("password");
		email = email.trim();
		password = password.trim();
		request.setAttribute("username", email);
		List<String> required = new ArrayList<String>();
		if (email.equals(""))
			required.add("username");
		if (password.equals(""))
			required.add("password");
		if (required.size()!=0) {
			mav.setViewName("connectors/toodledo/enterCredentials");
			mav.addObject("required", required);
			return mav;

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addAllObjects, addObject, setView, setViewName
 
        Map<String, Object> map = new HashMap<String, Object>(); 
        map.put("reloadFrames", reloadFrames); 
 
        ModelAndView result = super.handleRequestInternal(request, response); 
        result.addObject("model", map); 
        return result; 
    } 
 
    public void setPlayerService(PlayerService playerService) { 
        this.playerService = playerService; 
    } 
 
    public void setReloadFrames(List<ReloadFrame> reloadFrames) { 
        this.reloadFrames = reloadFrames; 
    } 
 
    public void setMediaFileService(MediaFileService mediaFileService) { 
        this.mediaFileService = mediaFileService; 
    } 

7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addObject, setViewName
        modelAndView.addObject("iLength",iDisplayLength);
        return modelAndView;
    } 
     
    private ModelAndView getLoanModelAndView(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("viewDashboardDetails");
        String[] tableHeaders = dashboardServiceFacade.getLoanHeaders();
        modelAndView.addObject("tableHeaders",tableHeaders);
        modelAndView.addObject("type",'l');
        modelAndView.addObject("disableSorting","0 , 4");
        return modelAndView;
    } 
     
    private ModelAndView getCustomerModelAndView(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("viewDashboardDetails");
        String[] tableHeaders = dashboardServiceFacade.getCustomerHeaders();
        modelAndView.addObject("tableHeaders",tableHeaders);
        modelAndView.addObject("type",'c');
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addObject, setViewName
	} 
	 
	 
	@RequestMapping(value="/login",method=RequestMethod.POST)
	public ModelAndView login(String username,String password,HttpServletRequest request){
		ModelAndView mv=new ModelAndView("");
		if( USERNAME.equals(username)&& PASSWORD.equals(password)){
			request.getSession().setAttribute("user", username);
			mv.setViewName("redirect:/manager/students");
		}else{ 
			mv.setViewName("forward:/");
			mv.addObject("username",username);
			mv.addObject("message", "username or password error ");
		} 
		return mv;
	} 
	 
	 
	@RequestMapping(value="/loginout",method=RequestMethod.POST)
	public ModelAndView loginOut(HttpServletRequest request){
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:addObject, setViewName
 
	/** 
	 * Get the users details for the 'personal' page 
	 */ 
	private ModelAndView errorModelAndView(Exception ex) {
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.setViewName("error");
		modelAndView.addObject("name", ex.getClass().getSimpleName());
		modelAndView.addObject("user", userDao.readUserName());
 
		return modelAndView;
	} 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
setViewName Method Overview
Set a view name for this ModelAndView, to be resolved by the DispatcherServlet via a ViewResolver.
See Code Examples for other Spring Framework ModelAndView Methods: