`

如何在springmvc中获取国际化信息

阅读更多
public class SpringContext implements ApplicationContextAware {


	public static String getMessage(String code, HttpServletRequest request) {
		Locale locale = RequestContextUtils.getLocaleResolver(request).resolveLocale(request);
		return applicationContext.getMessage(code, null, locale);
	}

	public static String getMessage(String code, String defaultMsg, HttpServletRequest request) {
		Locale locale = RequestContextUtils.getLocaleResolver(request).resolveLocale(request);
		return applicationContext.getMessage(code, null, defaultMsg, locale);
	}
分享到:
评论

相关推荐

    springmvc国际化demo

    用springmvc做的一个国际化小例子,包含如何在页面和java代码中获取国际化资源

    基于ssm+vue留学生交流互动论坛网站系统源码+文+ppt全套

    对国际教育感兴趣的人群可以通过该系统了解国际教育的趋势和发展方向,获取留学相关的资源和信息。 其他说明:该系统采用B/S架构,用户可以通过浏览器进行访问和使用。前端使用Vue.js框架搭建,界面简洁美观、交互...

    SpringMVCDemo:Spring MVC 框架知识案例

    6.Spring MVC 国际化案例 7.Spring MVC 请求转发与请求重定向案例 8.Spring MVC 下载 Excel 文档的需求案例 9.Spring MVC RESTful 风格的请求方式案例 10.Spring + Spring MVC + JDBCTemplate 整合并通过 RESTful ...

    MRCMS内容管理系统-其他

    国际化支持,自定义各个国家语言在模板中做数据绑定。 添加了页面静态化支持,我们可以将动态生成页面,持久化降低计算时间,从而提高网站性能。 更新了文章编辑器,提供 HTML、text/markdown 编辑功能。 构建项目:...

    springboot知识点整理

    4.8.2 登录页面国际化 74 4.8.3 登录 80 4.8.4 拦截器进行登录检查 81 4.8.5 实验要求(没按要求做,不想改了!) 82 4.8.6 CRUD-员工列表 83 4.8.7 CRUD-员工修改 86 4.8.8 CRUD-员工添加 87 4.8.9 CRUD-员工删除 ...

    JS组件Bootstrap Table使用方法详解

    bootStrap table 是一个轻量级的table插件,使用AJAX获取JSON格式的数据,其分页和数据填充很方便,支持国际化 三、使用方法 1、引入js、css [js] view plain copy <!--css样式--> <link href="css/...

    尚硅谷springboot视频(上)

    尚硅谷_SpringBoot_web开发-【实验】-国际化 尚硅谷_SpringBoot_web开发-【实验】-登陆&拦截器 尚硅谷_SpringBoot_web开发-【实验】-Restful实验要求 尚硅谷_SpringBoot_web开发-【实验】-员工列表-公共页抽取 ...

    SpringBoot学习视频

    尚硅谷_SpringBoot_web开发-【实验】-国际化 尚硅谷_SpringBoot_web开发-【实验】-登陆&拦截器 尚硅谷_SpringBoot_web开发-【实验】-Restful实验要求 尚硅谷_SpringBoot_web开发-【实验】-员工列表-公共页抽取 ...

    尚硅谷Spring boot核心技术篇(上)

    -国际化 36、尚硅谷_SpringBoot_web开发-【实验】-登陆&拦截器 37、尚硅谷_SpringBoot_web开发-【实验】-Restful实验要求 38、尚硅谷_SpringBoot_web开发-【实验】-员工列表-公共页抽取 39、尚硅谷_SpringBoot_web...

    128元尚硅谷Java视频教程_SpringBoot视频教程(上)核心技术篇

    35、尚硅谷_SpringBoot_web开发-【实验】-国际化 36、尚硅谷_SpringBoot_web开发-【实验】-登陆&拦截器 37、尚硅谷_SpringBoot_web开发-【实验】-Restful实验要求 38、尚硅谷_SpringBoot_web开发-【实验】-员工...

    Java SpringBoot课件+源码视频教程

    35、_SpringBoot_web开发-【实验】-国际化 36、_SpringBoot_web开发-【实验】-登陆&拦截器 $ |' \$ J3 {' e6 G" m) h( o" F 37、_SpringBoot_web开发-【实验】-Restful实验要求 & J/ l' y/ p& k5 o/ M" a) m 38、_...

Global site tag (gtag.js) - Google Analytics