@RequestMapping(value="${adminPath}/switchlanguage",method = RequestMethod.GET)public String changeLanguage(HttpServletRequest request,HttpServletResponse response, @RequestParam String currentlang, Model model) { CookieLocaleResolver localeResolver = (CookieLocaleResolver) RequestContextUtils.getLocaleResolver(request); if ("zh_CN".equals(currentlang)) { localeResolver.setLocale(request, response, new Locale("en", "US")); } else{ localeResolver.setLocale(request, response, new Locale("zh", "CN")); } return "/view/sysLogin";}
<a style="color: #1E90FF"
href="${pageContext.request.contextPath}/admin/switchlanguage?currentlang=${currentLocale}"><fmt:message key="btn_switch_language" /></a>