title: Accessing properties file in Spring Expression Language
body: <p>I created a simple web application with Thymeleaf using Spring Boot. I use the application.properties file as configuration. What I'd like to do is add new properties such as name and version to that file and access the values from Thymeleaf.</p>
  
  <p>I have been able to achieve this by creating a new JavaConfiguration class and exposing a Spring Bean:</p>
  
  <pre><code>@Configuration
  public class ApplicationConfiguration {
  
      @Value("${name}")
      private String name;
  
      @Bean
      public String name() {
          return name;
      }
  
  }
  </code></pre>
  
  <p>I can then display it in a template using Thymeleaf like so:</p>
  
  <pre><code>&lt;span th:text="${@name}"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>This seems overly verbose and complicated to me. What would be a more elegant way of achieving this?</p>
  
  <p>If possible, I'd like to avoid using xml configuration.</p>