title: @Value not working inside a class which extends other
body: <p>Is it possible to use <code>@Value</code> inside a class that extends another class?</p>
  
  <p>Below are the relevant code snippets. In the <code>Lo_Controller</code> class it works perfectly, but in the <code>Lo_DisplayHandler</code> always returns <code>null</code>. The only reason I can think of is because it depends on another class, which is not annotated with <code>@Component</code>. If that is the cause, what is the recommended option to read a value from properties file similar to <code>@Value</code>?</p>
  
  <p>Just to test it out, I changed from <code>@Component</code> to <code>@Controller</code> in <code>Lo_DisplayHandler</code> to see, if they are somehow related to each other, however it returns <code>null</code> as well.</p>
  
  <p>This works:</p>
  
  <pre><code>package com.ma.common.controller;
  imports ...
  
  @Controller
  @RequestMapping("/log")
  public class Lo_Controller {
         @Value("${log.display.lastpage}")
         private String lastPageUrl;
  ...
  </code></pre>
  
  <p>This always returns <code>null</code>:</p>
  
  <pre><code>package com.ma.log.handler;
  imports ...
  @Component
  public class Lo_DisplayHandler extends Lo_Handler {
         public Lo_DisplayHandler() {
                super();
         }
         @Value("${log.display.lastpage}")
         private String lastPageUrl;
  ... 
  </code></pre>
  
  <p><strong>mvc-dispatcher-servlet.xml</strong></p>
  
  <pre><code>&lt;context:component-scan base-package="com.ma.common.controller, com.ma.log.handler" /&gt;
  &lt;context:property-placeholder location="classpath:restServices.properties"/&gt;
  
  &lt;mvc:annotation-driven /&gt;
  &lt;mvc:resources mapping="/**" location="/" /&gt;
  
  
  @Component
  public class Lo_DisplayHandler extends Lo_Handler {
  
         @Value("${log.display.lastpage}")
         private String lastPageUrl;
  
         public void anyOtherMethod(){
                String _a = lastPageUrl; //FAIL - always null
         }
  
         @PostConstruct
         public void initIt() throws Exception {
                String _a = lastPageUrl; //OK - when the application is deployed and started for the first time
         }
  
         @PreDestroy
         public void cleanUp() throws Exception {
                String _a = lastPageUrl; //OK - when the application is stopped
         }
  
  web.xml
  
         &lt;servlet&gt;
                &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
                &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
                &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
         &lt;/servlet&gt;
  
         &lt;servlet-mapping&gt;
                &lt;servlet-name&gt;mvc-dispatcher&lt;/servlet-name&gt;
                &lt;url-pattern&gt;/&lt;/url-pattern&gt;
         &lt;/servlet-mapping&gt;
  
         &lt;context-param&gt;
                &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
                &lt;param-value&gt;/WEB-INF/mvc-dispatcher-servlet.xml&lt;/param-value&gt;
         &lt;/context-param&gt;
  
         &lt;listener&gt;
                &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
         &lt;/listener&gt;
  </code></pre>