Siguiendo las instrucciones here tengo este código:¿cómo habilito POJO-mapping programáticamente en Jersey usando Grizzly2?
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();
}
Siguiente Quiero habilitar el soporte JSON POJO como se describe here, pero el problema es que yo quiero hacerlo mediante programación en lugar de a través de un archivo web.xml (¡No tengo un archivo web.xml!).
¿Cómo puedo modificar el código anterior para habilitar la función de mapeo JSON POJO?