其他链接:http://blog.csdn.net/jinwufeiyang/article/details/52338268如何将我们网站的其它内容(如菜单、标题等)做国际化处理呢?这就是本篇要将的内容—>国际化。在项目的spring. [html ...
其他链接:http://blog.csdn.net/jinwufeiyang/article/details/52338268
如何将我们网站的其它内容(如菜单、标题等)做国际化处理呢?这就是本篇要将的内容—>国际化。
在项目的spring.
[html] view plain copy
- package com.zhidao.oms.index;
-
- import java.util.Locale;
-
- import javax.servlet.http.HttpServletRequest;
-
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestParam;
-
- @Controller
- @RequestMapping("/index")
- public class IndexAction {
-
-
- @RequestMapping("/findex")
- public String Findex(HttpServletRequest request,@RequestParam String langType,String page){
-
- if(langType.equals("zh")){
- Locale locale = new Locale("zh", "CN");
- request.getSession().setAttribute("i18nlanguage",locale);
- }
- else if(langType.equals("en")){
- Locale locale = new Locale("en", "US");
- request.getSession().setAttribute("i18nlanguage",locale);
- }else{
- request.getSession().setAttribute("i18nlanguage",Locale.getDefault());
- }
- return "/front/"+page+".jsp";
- }
-
- }
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:基于Session的国际化实现
关键词:session
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。