title: What exactly is the ResourceConfig class in Jersey 2?
body: <p>I have seen a lot of Jersey tutorials that starts with something like</p>
  
  <pre><code>@ApplicationPath("services")
  public class JerseyApplication extends ResourceConfig {
      public JerseyApplication() {
          packages("com.abc.jersey.services");
      }
  }
  </code></pre>
  
  <p>without explaining what exactly the <code>ResourceConfig</code> class is. So where can I find its documentation, usage, etc.? Googling for "jersey resourceconfig" does not yield any official doc.</p>
  
  <p>Some of my questions about this class and its usage are:</p>
  
  <ul>
  <li>What things can I do inside the subclass of <code>ResourceConfig</code>? </li>
  <li>Do I need to register the subclass of <code>ResourceConfig</code> somewhere so that it can be found or is it automatically detected by Jersey? </li>
  <li>If the subclass is automatically detected what happens if I have multiple subclasses of <code>ResourceConfig</code>?</li>
  <li>Is the purpose of <code>ResourceConfig</code> the same as the <code>web.xml</code> file? If so what happens if I have both in my project? Does one of them take precedence over the other?</li>
  </ul>