title: accessing property from external configuration using Spring Boot
body: <p>I have a spring boot web service in which I'm trying to access an external property in a controller, e.g.</p>
  
  <pre><code>@RestController
  public class GreetingController {
      @Value( "${my.name}" )
      String myname
  ...
  </code></pre>
  
  <p>The problem is that it fails to compile, giving the error</p>
  
  <pre><code>Attribute 'value' should have type 'java.lang.String'; but found type 'java.lang.Object' in @org.springframework.beans.factory.annotation.Value
  </code></pre>
  
  <p>Can someone please point out what I'm doing wrong here?</p>
  
  <p>Thanks!</p>
  
  <p>--john</p>