-
Notifications
You must be signed in to change notification settings - Fork 343
Open
Description
我按照 四步完成Spring国际化动态配置 上面配好了resolver
并在controller里处理:
@Get
public String index(Invocation inv, @Param("language") String language) {
if (language != null) {
Locale locale = org.springframework.util.StringUtils.parseLocaleString(language);
logger.debug("language: {}, locale: {}", language, locale);
resolver.setLocale(inv.getRequest(), inv.getResponse(), locale);
}
return "index";
}在jsp里打印:
${pageContext.request.locale}, <spring:message code="web.title"/>
结果 /?language=zh_CN 访问,logger里能打出来是:zh_CN,cookie里也能看到是zh_CN
但是jsp里,仍然是en_US
求教。。。
Metadata
Metadata
Assignees
Labels
No labels