Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Where to place .properties file? for ResourceBundle

jose luis romero
6 years ago Mar 07, 2016 3:08pm
jose luis romero
6 years ago Mar 07, 2016 6:04pm
Andris Lapinsh
6 years ago Mar 08, 2016 8:31am

Place you properties files into Project/src/main/resources
and use maven-resources-plugin in pom file:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <encoding>${project.encoding}</encoding>
                </configuration>
            </plugin>

in java code just call

messages = ResourceBundle.getBundle("MessagesBundle", getLocale());
jose luis romero
6 years ago Mar 08, 2016 2:40pm