首页>代码>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) {

    }
}
最近下载更多
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  LV12 2022年12月3日
呵呵哈哈哈  LV10 2022年7月8日
Ty  LV10 2022年6月27日
CHENHAOJUDA  LV10 2022年6月14日
aqin_qin  LV1 2022年6月3日
最近浏览更多
saviorasd  LV1 4月19日
WBelong  LV7 4月2日
1491713781  LV8 3月5日
gecongkai  LV8 2023年12月24日
skook7  LV2 2023年12月14日
skipple3  LV39 2023年10月25日
漫步的海星  LV4 2023年9月26日
yshysh123 2023年9月20日
暂无贡献等级
飞呀飞呀飞不放  LV7 2023年8月9日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友