首页>代码>springboot+jpa+bootstrap+mysql用户登录+增删改查 运行环境为IDEA>/springboot-jba/src/main/java/ng/bq/springbootjba/component/MyLocalResolver.java
package ng.bq.springbootjba.component;

import org.springframework.util.StringUtils;
import org.springframework.web.servlet.LocaleResolver;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Locale;

public class MyLocalResolver implements LocaleResolver {
    @Override
    public Locale resolveLocale(HttpServletRequest request) {
        String l=request.getParameter("l");
        Locale locale=Locale.getDefault();
        if(!StringUtils.isEmpty(l)){
            String[] split =l.split("_");
            locale=new Locale(split[0],split[1]);

        }
        return locale;
    }

    @Override
    public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) {

    }
}
最近下载更多
可乐要加冰1  LV8 2024年11月29日
15342201772  LV9 2024年6月26日
计科一班  LV7 2024年6月19日
15719908287  LV9 2024年5月28日
skipple3  LV39 2023年10月25日
飞呀飞呀飞不放  LV7 2023年8月9日
hbsoft2008  LV16 2023年3月21日
lyws1986  LV17 2023年3月13日
微信网友_6368711690080256  LV3 2023年2月28日
zhaoming200677  LV13 2022年12月3日
最近浏览更多
可乐要加冰1  LV8 2024年11月29日
15342201772  LV9 2024年6月26日
TY0165  LV20 2024年6月25日
17380184110 2024年6月19日
暂无贡献等级
计科一班  LV7 2024年6月19日
15719908287  LV9 2024年5月28日
2726018975  LV1 2024年5月25日
shuangfu  LV25 2024年5月7日
saviorasd  LV1 2024年4月19日
WBelong  LV8 2024年4月2日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友