Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rose如何在jsp里使用i18n支持? #31

Open
met-pub opened this issue Jun 10, 2016 · 0 comments
Open

rose如何在jsp里使用i18n支持? #31

met-pub opened this issue Jun 10, 2016 · 0 comments

Comments

@met-pub
Copy link

met-pub commented Jun 10, 2016

我按照 四步完成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
求教。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant