title: How to retrieve value normally wired by @Value from WebApplicationContext in a Servlet?
body: <p>I usually annotate some value fields with <code>@Value</code>, e.g.</p>
  
  <pre><code>class NotASpringBean {
      @Value("${test.value}")
      String testValue;
  }
  </code></pre>
  
  <p>Note no <code>@Component</code>, no XML entry for this class. That's the reason of trouble.
  I wire it up with <code>SpringBeanAutowiringSupport.processInjectionBasedOnServletContext</code></p>
  
  <p>I have to assign the would-have-been value of <code>testValue</code> w/o <code>@Value</code> (or in other words: w/o automatic class processing done by Spring usually).</p>
  
  <p>I have a <code>WebApplicationContext</code> but don't know if it's possible to get the same value that <code>testValue</code> would receive?</p>
  
  <hr>
  
  <p>To be precise, I have  </p>
  
  <pre><code>&lt;context:property-placeholder location="classpath:/props.properties"/&gt;
  </code></pre>
  
  <p>in my root spring context and I need to access those properties in a Servlet.. and <code>@Value</code> doesn't work. I've worked around it with <code>@Autowired @Qualifier</code> combo, but I had to duplicate properties in XML by defining bean per property.</p>
  
  <p>Also note: I <strong>cannot</strong> move the properties include to a different file.</p>