title: how do I enable POJO-mapping programatically in Jersey using Grizzly2?
body: <p>Following the instructions <a href="http://jersey.java.net/nonav/documentation/latest/user-guide.html#getting-started" rel="noreferrer">here</a> I have this code:</p>
  
  <pre><code>private static URI getBaseURI() {
      return UriBuilder.fromUri("http://localhost/").port(9998).build();
  }
  
  public static final URI BASE_URI = getBaseURI();
  
  protected static HttpServer startServer() throws IOException {
      System.out.println("Starting grizzly...");
      final ResourceConfig rc = new PackagesResourceConfig("amplify.api.resources");
      return GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
  }
  
  public static void main(final String[] args) throws IOException {
      final HttpServer httpServer = startServer();
      System.out.println(String.format("Jersey app started with WADL available at "
              + "%sapplication.wadl\nTry out %shelloworld\nHit enter to stop it...", BASE_URI, BASE_URI));
      System.in.read();
      httpServer.stop();
  }
  </code></pre>
  
  <p>Next I want to enable JSON POJO support as described <a href="http://jersey.java.net/nonav/documentation/latest/user-guide.html#json.pojo.approach.section" rel="noreferrer">here</a>, but the problem is that I want to do it programmatically rather than through a web.xml file (I don't have a web.xml file!).</p>
  
  <p>How can I modify the code above to enable the JSON POJO mapping feature?</p>