How to create web app i18n with SpringBoot and JSF




Asked on March 05, 2017
I want to build a web application that supports multiple languages. I have integrated SpringBoot, JSF and use resouce bunlde to display my label. But I have a problem with encoding UTF-8.
Please guide me how to integrated SpringBoot and JSF using resource bundle.
Thanks a lot!




Replied on March 05, 2017
You need to configure MessageSource in your MVC configuration.

@Bean
public MessageSource messageSource() {
    ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
    messageSource.setBasename("/i18/usermsg");
    messageSource.setDefaultEncoding("UTF-8");
    return messageSource;

Find the URLs that can help you.

http://www.concretepage.com/spring-4/spring-4-mvc-internationalization-i18n-and-localization-l10n-annotation-example

http://www.concretepage.com/spring-4/spring-4-jsf-2-integration-example-using-autowired-annotation




Write Answer










©2024 concretepage.com | Privacy Policy | Contact Us