I am using spring boot with thymeleaf. This is my project structure:
And this is my App start class:
@EnableAutoConfiguration
@Configuration
@ComponentScan
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class);
}
}
I have this on my home.leaf.html: <p th:text = "#{username}"></p>
But when I run this application this is what I get: ??username_en_US??
I have tried various things on how to resolve this configuration issue. Please, can anyone help?
Refer the official documentation for spring boot
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-convert-an-existing-application-to-spring-boot
It says
Static resources can be moved to
/public
(or/static
or/resources
or/META-INF/resources
) in the classpath root. Same formessages.properties
(Spring Boot detects this automatically in the root of the classpath).
So you should create ur internationalization file as messages.properties
and place in the root classpath.
Or you can also edit the default location to a more proper location by adding this entry in the application.properties
file
#messages
spring.messages.basename=locale/messages
so you can store your files in the locale folder inside resources folder, with the name messages.properties
or in any specific language.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With