提交 | 用户 | 时间
|
58d006
|
1 |
package com.mandi.springmvc; |
A |
2 |
import java.util.Locale; |
|
3 |
import javax.servlet.http.HttpServletRequest; |
|
4 |
import javax.servlet.http.HttpServletResponse; |
|
5 |
import org.apache.log4j.Logger; |
|
6 |
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; |
|
7 |
|
|
8 |
/** |
|
9 |
* @author mengly |
|
10 |
* @version 创建时间:2015年6月18日 下午3:34:21 |
|
11 |
* 类说明 |
|
12 |
*/ |
|
13 |
|
|
14 |
public class LocalInterceptor extends HandlerInterceptorAdapter { |
|
15 |
final Logger logger = Logger.getLogger(LocalInterceptor.class); |
|
16 |
@Override |
|
17 |
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
|
18 |
Locale l=new Locale("en"); |
|
19 |
logger.info(l.getCountry()); |
|
20 |
return true; |
|
21 |
} |
|
22 |
} |