package com.mandi.springmvc; import java.util.Locale; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; /** * @author mengly * @version 创建时间:2015年6月18日 下午3:34:21 * 类说明 */ public class LocalInterceptor extends HandlerInterceptorAdapter { final Logger logger = Logger.getLogger(LocalInterceptor.class); @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { Locale l=new Locale("en"); logger.info(l.getCountry()); return true; } }