title: How to inject dependencies into resources with Jersey?
body: <p>I'm having the following code:</p>
  
  <pre><code>@Path("stores")
  class StoreResources {
  
    private ServerConfig config;
  
    @GET
    public String getAll() {
     //do some stuff with ServerConfig
    }
  }
  </code></pre>
  
  <p>And I need the <code>ServerConfig</code> object to be injected into this class from outside and use it inside the <code>getAll()</code> method.</p>
  
  <p>What are the possible ways to achieve it? Should I use a DI framework like Guice or Spring?</p>