title: How can I inject local variables of a static method inside an abstract class using Spring?
body: <p>I'm new to Spring and ran into this problem.I tried using @Autowired on the method but it didnt work,on the variables I get the error "The annotation @Autowired is disallowed for this location" from eclipse.
  I have the required beans created in the xml.</p>
  
  <p>Below is the code,this method is inside an abstract class..</p>
  
  <pre><code>private static HttpResponse rawExecuteReqeust(HttpUriRequest request) throws ClientProtocolException, IOException {
      HttpClient client = new DefaultHttpClient();
      ProxyInterface proxyI; // needs to be Injected
      User user; // needs to be Injected
      System.out.println("About to execute " + request.getMethod() + " request on        " 
          + request.getURI());
      if (proxyI.getProxyHost() != null &amp;&amp; proxyI.getProxyPort() != 0) {
          if (user.getProxyUser() != null &amp;&amp; user.getProxyPassword() != null) {
              ((AbstractHttpClient) client).getCredentialsProvider().setCredentials(
                      new AuthScope(proxyI.getProxyHost(), proxyI.getProxyPort()),
                      new UsernamePasswordCredentials(user.getProxyUser(), user.getProxyPassword()));
          }
          HttpHost proxy = new HttpHost(proxyI.getProxyHost(), proxyI.getProxyPort(), "http");
          client.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
      }
      HttpResponse response = client.execute(request);
      return response;
  }
  </code></pre>
  
  <p>(p.s Im new to stackOverflow and hope I formatted the question properly :) )</p>