title: boolean values in Spring application.properties file?
body: <p>Is it possible to have boolean values in Spring configuration file?</p>
  
  <p>I wrote the following field in my bean:</p>
  
  <pre><code>@Value("${pdk.populatedemo}")
  private boolean populateDemo;
  </code></pre>
  
  <p>but if causes the following exception:</p>
  
  <pre><code>Could not autowire field: private boolean com.inthemoon.pdk.data.DatabaseService.populateDemo; nested exception is org.springframework.beans.TypeMismatchException: 
  Failed to convert value of type [java.lang.String] to required type [boolean]; nested exception is java.lang.IllegalArgumentException: 
  Invalid boolean value [1;]
  </code></pre>
  
  <p>here I tried</p>
  
  <pre><code>pdk.populatedemo=1;
  </code></pre>
  
  <p>in <code>application.properties</code>. I also tried <code>=true</code> and some others.</p>