title: How to Read values from a properties file in thymleaf
body: <p>Is there a way to read values from properties file in thymleaf using spring boot?
  eg:- validation messages, load labels from the properties file.</p>
  
  <p>I'm using <strong>spring boot 2.1.3 version &amp; thymleaf 3.0.11 version</strong> 
  I need to dynamically set labels in my application using the properties file. I couldn't find a way to access properties file directly in thymleaf.</p>
  
  <p>I tried creating <strong>lables.properties</strong> file in resources 
  eg:-</p>
  
  <pre><code>field1 = "Name"
  field2 = "Description"
  </code></pre>
  
  <p>I tried to access in thymleaf using like this,</p>
  
  <pre><code>&lt;a href="./admin"&gt;&lt;p class="text-uppercase" th:text="#{field1}"&gt;&lt;/p&gt;&lt;/a&gt; 
  </code></pre>
  
  <p>But it was not working like this.</p>
  
  <p>It displays as <strong>??label1_en_US??"</strong> in my HTML view.
  Can anyone help me for sort this out?</p>