Package org.jtalks.jcommune.model.entity

Examples of org.jtalks.jcommune.model.entity.Language


    @RequestMapping(value = "**/language", method = RequestMethod.GET)
    public String saveUserLanguage(@RequestParam(value = "lang", defaultValue = "en") String lang,
                                   HttpServletResponse response, HttpServletRequest request) throws ServletException {
        JCUser jcuser = userService.getCurrentUser();
        Language languageFromRequest = Language.byLocale(new Locale(lang));
        if (!jcuser.isAnonymous()) {
            changeLanguageWithLockHandling(jcuser, languageFromRequest);
        }
        LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
        localeResolver.setLocale(request, response, languageFromRequest.getLocale());
        return "redirect:" + request.getHeader("Referer");
    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.model.entity.Language

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.