Commit 96e9e0f4 authored by Quxl's avatar Quxl

xx

parent 79a3f0ec
......@@ -2,7 +2,6 @@ package com.egolm.film.config.interceptor;
import java.util.Locale;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
......@@ -17,11 +16,7 @@ public class LocaleCookieInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest req, HttpServletResponse resp, Object handler) throws Exception {
Cookie[] cookies = req.getCookies();
if(cookies != null && cookies.length > 0) {
for(Cookie cookie : cookies) {
if(cookie.getName().equals(language)) {
String str = cookie.getValue();
String str = req.getParameter(language);
if(str == null || str.trim().length() == 0) {
str = "zh_CN";
}
......@@ -31,10 +26,5 @@ public class LocaleCookieInterceptor extends HandlerInterceptorAdapter {
LocaleContextHolder.setLocale(new Locale(language, country));
return super.preHandle(req, resp, handler);
}
}
}
LocaleContextHolder.setLocale(Locale.CHINA);
return super.preHandle(req, resp, handler);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment