title: Configuring Grizzly with a web.xml
body: <p>I can start grizzly and deploy Jersey webservices on it with the following lines.</p>
  
  <pre class="lang-java prettyprint-override"><code>protected HttpServer create() throws Throwable {
    ResourceConfig rc = new PackagesResourceConfig("com.resource", "com.provider");
    HttpServer server = GrizzlyServerFactory.createHttpServer(uri, rc);
    return server;
  }
  </code></pre>
  
  <p>But is there a way to load a <code>web.xml</code> instead of a <code>ResourceConfig</code>?</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;web-app&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;Jersey&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
        &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
        &lt;param-value&gt;com.resource, com.provider&lt;/param-value&gt;
      &lt;/init-param&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Jersey&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>