---
title: "spring技巧"
author: "wander_bird"
date: "2015-02-27T14:33:11Z"
tags: []
categories: ["企业架构"]
slug: "spring"
draft: false
lastmod: "2015-02-27T14:34:10Z"
id: 2187167
url: "https://wander-bird.iteye.com/blog/2187167"
---

**1.获取前端request context**

```java
@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";
	}
```