java - Accessing properties file in Spring Expression Language -
I have created a simple web application with Themelif using Spring Boot I have applied the application.properties file as a configuration I use What I would like to do is add new properties such as name and version to that file and get the values of thimmelaf.
I am able to get it by creating a new Java configuration class and highlighting a spring Bean:
Then I can display it in a template using Thymeleaf:
& lt; Span th: text = "$ {@ name}" & gt; & Lt; / Span & gt;
This is a lot more functional and complex for me.
If possible, I would like to avoid using XML configuration.
You can get it through the environment
eg .: < / P>
$ {@ environment.getProperty ('name')}
Comments
Post a Comment