spring技巧

1.获取前端requestcontext

@RequestMapping("/search/data")
	public String search(PagingVO page, FrontCourseCatalogSearchVO searchVO, Model model, HttpServletRequest request) {
		page.setPageSize(searchVO.getMySize());
		
		searchVO.setInternalOnly(isInternalOnlySearch());
		
		PagingVO vo = catalogService.search(page, searchVO);
		model.addAttribute("pageSize", page.getPageSize());
		model.addAttribute("pageVO", vo);
		RequestContext context = new RequestContext(request);
		model.addAttribute("lookupDeliveries", lookupService.getDeliveryMethod(context.getLocale().getLanguage()));

		return "view/front/course/search_data";
	}

相关推荐